Browse Source

🎨 Auto format

pull/15144/head
pre-commit-ci-lite[bot] 4 months ago
committed by GitHub
parent
commit
54b6cd782d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      docs/en/docs/tutorial/path-params.md
  2. 1
      docs_src/path_params/tutorial006_py310.py

2
docs/en/docs/tutorial/path-params.md

@ -250,7 +250,7 @@ And you only have to declare them once.
That's probably the main visible advantage of **FastAPI** compared to alternative frameworks (apart from the raw performance). That's probably the main visible advantage of **FastAPI** compared to alternative frameworks (apart from the raw performance).
### Path Parameters with Validation { #path-params-validation } ### Path Parameters with Validation { #path-parameters-with-validation }
You can also add validation to your path parameters using Path. You can also add validation to your path parameters using Path.

1
docs_src/path_params/tutorial006_py310.py

@ -2,6 +2,7 @@ from fastapi import FastAPI, Path
app = FastAPI() app = FastAPI()
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int = Path(..., ge=1, le=1000)): def read_item(item_id: int = Path(..., ge=1, le=1000)):
return {"item_id": item_id} return {"item_id": item_id}
Loading…
Cancel
Save