mirror of
https://github.com/fastapi/fastapi.git
synced 2026-11-21 10:13:53 +08:00
16 lines
331 B
Python
16 lines
331 B
Python
from typing import Annotated
|
|
|
|
from fastapi import FastAPI, Query
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(
|
|
hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None,
|
|
):
|
|
if hidden_query:
|
|
return {"hidden_query": hidden_query}
|
|
else:
|
|
return {"hidden_query": "Not found"}
|