Helpers (fastapi_responseschema.helpers)
wrap_error_responses
def wrap_error_responses(
app: FastAPI,
error_response_schema: Type[AbstractResponseSchema]) -> FastAPI
Wraps all exception handlers with the provided response schema.
Arguments:
appFastAPI - A FastAPI application instance.error_response_schemaType[AbstractResponseSchema] - Response schema wrapper model.
Returns:
FastAPI- The application instance
wrap_app_responses
def wrap_app_responses(app: FastAPI,
route_class: Type[SchemaAPIRoute]) -> FastAPI
Wraps all app defaults responses
Arguments:
appFastAPI - A FastAPI application instance.route_classType[SchemaAPIRoute] - The SchemaAPIRoute with your response schemas.
Returns:
FastAPI- The application instance.