Coverage for docs_src/query_params_str_validations/tutorial014.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from typing import Union 1abcde
3from fastapi import FastAPI, Query 1abcde
5app = FastAPI() 1abcde
8@app.get("/items/") 1abcde
9async def read_items( 1abcde
10 hidden_query: Union[str, None] = Query(default=None, include_in_schema=False),
11):
12 if hidden_query: 1abcde
13 return {"hidden_query": hidden_query} 1abcde
14 else:
15 return {"hidden_query": "Not found"} 1abcde