Parameters declared in the path ({itemid}) are path parameters; any other simple function argument is a query parameter. A default value makes it optional. Adding validation Path() and Query() with Annotated add constraints and documentation: Constraint Meaning gt, ge, lt, le numeric bounds minlength, maxlength string length pattern regular expression alias different name in the URL (item-query) list[str] = Query([]) repeated values ?tag=a&tag=b Enums Use an Enum subclass to restrict a parameter to known values — the docs show a dropdown.