A path parameter is a variable in the URL, declared between braces and taken up as a function argument. Its annotated type (for example int) is used to convert and validate the value; an invalid value returns a 422 error.
Example
@app.get('/items/{item_id}')
def lire(item_id: int):
return {'id': item_id}