prefect.server.utilities.server
method_paths_from_routes
PrefectAPIRoute
request.scope['fastapi_astack']
which is an async stack for
the full scope of the request. This stack is used for managing contexts of FastAPI
dependencies. If we want to close a dependency before the request is complete
(i.e. before returning a response to the user), we need a stack with a different
scope. This extension adds this stack at request.state.response_scoped_stack
.
Methods:
get_route_handler
PrefectRouter
add_api_route
response_model
,
use return type annotation to infer the response model.
For routes that return No-Content status codes, explicitly set
a response_class
to ensure nothing is returned in the response body.