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