operations
fix_api_docs(app=None)
Fix error loading /docs when a root_path is set.
Call after declaring an app with a root_path set, for example: app = FastAPI(root_path="/some/path") fix_api_docs(app)
When a root_path is declared, the default /docs URL breaks, and returns an error: Fetch error Not Found /api/v1/openapi.json
Source code in src/red_utils/ext/fastapi_utils/operations.py
get_app(debug=False, cors=True, root_path='/', title='DEFAULT_TITLE', description='DEFAULT_DESCRIPTION', version='0.0.0', openapi_url=default_openapi_url, openapi_tags=tags_metadata, routers=None)
Generate a FastAPI app and return.
Source code in src/red_utils/ext/fastapi_utils/operations.py
update_tags_metadata(tags_metadata=tags_metadata, update_metadata=None)
Update the global tags_metadata list with new values.
Import this function in another app, create a new list of tags (or a single tag dict, {"name": ..., "description": ...}), then pass both the imported tags_metadata and the new list/single instance of tag objects.
This funciton will combine them into a new tags_metadata object