diff --git a/docs/en/docs/tutorial/path-params.md b/docs/en/docs/tutorial/path-params.md index 8909124799..f405547220 100644 --- a/docs/en/docs/tutorial/path-params.md +++ b/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). -### 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. diff --git a/docs_src/path_params/tutorial006_py310.py b/docs_src/path_params/tutorial006_py310.py index 083be07c43..e0e8c1be6e 100644 --- a/docs_src/path_params/tutorial006_py310.py +++ b/docs_src/path_params/tutorial006_py310.py @@ -2,6 +2,7 @@ from fastapi import FastAPI, Path app = FastAPI() + @app.get("/items/{item_id}") def read_item(item_id: int = Path(..., ge=1, le=1000)): - return {"item_id": item_id} \ No newline at end of file + return {"item_id": item_id}