mirror of
https://github.com/fastapi/fastapi.git
synced 2026-04-05 07:34:12 -04:00
⬆️ Upgrade configuration for Ruff v0.2.0 (#11075)
This commit is contained in:
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Union[str, None] = Query(default=None, min_length=3, max_length=50)
|
||||
q: Union[str, None] = Query(default=None, min_length=3, max_length=50),
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -8,7 +8,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None
|
||||
q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None,
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[str | None, Query(min_length=3, max_length=50)] = None
|
||||
q: Annotated[str | None, Query(min_length=3, max_length=50)] = None,
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None
|
||||
q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None,
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Union[str, None] = Query(default=None, title="Query string", min_length=3)
|
||||
q: Union[str, None] = Query(default=None, title="Query string", min_length=3),
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -8,7 +8,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None
|
||||
q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None,
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[str | None, Query(title="Query string", min_length=3)] = None
|
||||
q: Annotated[str | None, Query(title="Query string", min_length=3)] = None,
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None
|
||||
q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None,
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -5,7 +5,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: str | None = Query(default=None, title="Query string", min_length=3)
|
||||
q: str | None = Query(default=None, title="Query string", min_length=3),
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
hidden_query: Union[str, None] = Query(default=None, include_in_schema=False)
|
||||
hidden_query: Union[str, None] = Query(default=None, include_in_schema=False),
|
||||
):
|
||||
if hidden_query:
|
||||
return {"hidden_query": hidden_query}
|
||||
|
||||
@@ -8,7 +8,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None
|
||||
hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None,
|
||||
):
|
||||
if hidden_query:
|
||||
return {"hidden_query": hidden_query}
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None
|
||||
hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None,
|
||||
):
|
||||
if hidden_query:
|
||||
return {"hidden_query": hidden_query}
|
||||
|
||||
@@ -7,7 +7,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None
|
||||
hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None,
|
||||
):
|
||||
if hidden_query:
|
||||
return {"hidden_query": hidden_query}
|
||||
|
||||
@@ -5,7 +5,7 @@ app = FastAPI()
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
hidden_query: str | None = Query(default=None, include_in_schema=False)
|
||||
hidden_query: str | None = Query(default=None, include_in_schema=False),
|
||||
):
|
||||
if hidden_query:
|
||||
return {"hidden_query": hidden_query}
|
||||
|
||||
Reference in New Issue
Block a user