mirror of
https://github.com/fastapi/fastapi.git
synced 2026-03-31 05:05:53 -04:00
⬆️ Upgrade configuration for Ruff v0.2.0 (#11075)
This commit is contained in:
@@ -9,14 +9,14 @@ app = FastAPI()
|
||||
|
||||
@app.get("/hidden_cookie")
|
||||
async def hidden_cookie(
|
||||
hidden_cookie: Optional[str] = Cookie(default=None, include_in_schema=False)
|
||||
hidden_cookie: Optional[str] = Cookie(default=None, include_in_schema=False),
|
||||
):
|
||||
return {"hidden_cookie": hidden_cookie}
|
||||
|
||||
|
||||
@app.get("/hidden_header")
|
||||
async def hidden_header(
|
||||
hidden_header: Optional[str] = Header(default=None, include_in_schema=False)
|
||||
hidden_header: Optional[str] = Header(default=None, include_in_schema=False),
|
||||
):
|
||||
return {"hidden_header": hidden_header}
|
||||
|
||||
@@ -28,7 +28,7 @@ async def hidden_path(hidden_path: str = Path(include_in_schema=False)):
|
||||
|
||||
@app.get("/hidden_query")
|
||||
async def hidden_query(
|
||||
hidden_query: Optional[str] = Query(default=None, include_in_schema=False)
|
||||
hidden_query: Optional[str] = Query(default=None, include_in_schema=False),
|
||||
):
|
||||
return {"hidden_query": hidden_query}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ def get_client():
|
||||
|
||||
@app.post("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[str | None, Form(regex="^fixedquery$")] = None
|
||||
q: Annotated[str | None, Form(regex="^fixedquery$")] = None,
|
||||
):
|
||||
if q:
|
||||
return f"Hello {q}"
|
||||
|
||||
@@ -14,7 +14,7 @@ def get_client():
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[str | None, Query(regex="^fixedquery$")] = None
|
||||
q: Annotated[str | None, Query(regex="^fixedquery$")] = None,
|
||||
):
|
||||
if q:
|
||||
return f"Hello {q}"
|
||||
|
||||
Reference in New Issue
Block a user