pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
291 B
16 lines
291 B
from typing import Annotated
|
|
|
|
from fastapi import Depends, FastAPI
|
|
|
|
app = FastAPI(depends_default_parallelizable=True)
|
|
|
|
|
|
async def dep_seq() -> int:
|
|
return 1
|
|
|
|
|
|
@app.get("/users")
|
|
async def read_users(
|
|
x: Annotated[int, Depends(dep_seq, parallelizable=False)],
|
|
):
|
|
return {"x": x}
|
|
|