mirror of https://github.com/tiangolo/fastapi.git
17 lines
373 B
Python
17 lines
373 B
Python
from typing import Union
|
|
|
|
from fastapi import FastAPI, Query
|
|
from typing_extensions import Annotated
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(
|
|
hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None,
|
|
):
|
|
if hidden_query:
|
|
return {"hidden_query": hidden_query}
|
|
else:
|
|
return {"hidden_query": "Not found"}
|