Explore
Sign In
skills/fastapi__fastapi
1
0
Fork 0
You've already forked fastapi__fastapi
mirror of https://github.com/fastapi/fastapi.git synced 2026-09-14 13:36:21 +08:00
Code Issues Packages Projects Releases Wiki Activity
Files
859d40407caa3850862526ee689e2d22177cf19e
fastapi__fastapi/docs_src/path_params_numeric_validations/tutorial006.py
T

17 lines
345 B
Python
Raw Normal View History

:memo: Add Path params and numeric validators docs
2018-12-14 18:18:46 +04:00
from fastapi import FastAPI, Path, Query
app = FastAPI()
@app.get("/items/{item_id}")
async def read_items(
*,
✨ Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) * ✨ Do not require default value in Query(), Path(), Header(), etc * 📝 Update source examples for docs with default and required values * ✅ Update tests with new default values and not required Ellipsis * 📝 Update docs for Query params and update info about default value, required, Ellipsis
2022-05-13 18:38:22 -05:00
item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
:memo: Add Path params and numeric validators docs
2018-12-14 18:18:46 +04:00
q: str,
⬆ [pre-commit.ci] pre-commit autoupdate (#5709) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-10 19:49:18 +01:00
size: float = Query(gt=0, lt=10.5),
:memo: Add Path params and numeric validators docs
2018-12-14 18:18:46 +04:00
):
results = {"item_id": item_id}
if q:
results.update({"q": q})
return results
Reference in New Issue Copy Permalink
Version: v1.25.5 Page: 1639ms Template: 35ms
Auto
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어