-
First Check
Commit to Help
Example Code# Proposed change in fastapi/openapi/docs.py
def get_swagger_ui_html(...,
swagger_css_url: Annotated[
union[str, list[str]],
Doc(
"""
The URL to use to load the Swagger UI CSS.
It is normally set to a CDN URL.
"""
),
] = "https://cdn.jsdelivr.net/npm/[email protected]/swagger-ui.css",
...)
and use this list in generating the html code. DescriptionTo have a better flexibility on swagger UI CSS configuration, I propose being able to use multiple CSS files in Use case: Operating SystemmacOS Operating System DetailsNo response FastAPI Version0.108.0 Pydantic Version2.5.3 Python Version3.12.1 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Did you try overriding this feature or do you have an example? |
Beta Was this translation helpful? Give feedback.
-
Thanks! But I prefer to show people how to fully customize their docs UI any way they want as in here: https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/#self-hosting-javascript-and-css-for-docs If someone, for example you, wanted to have a more customized docs UI, it's possible to entirely override the whole HTML, which is more flexible than just the list of CSS and JS files to include. Given that, I'll pass on this request, but thanks for the interest! ☕ |
Beta Was this translation helpful? Give feedback.
Thanks! But I prefer to show people how to fully customize their docs UI any way they want as in here: https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/#self-hosting-javascript-and-css-for-docs
If someone, for example you, wanted to have a more customized docs UI, it's possible to entirely override the whole HTML, which is more flexible than just the list of CSS and JS files to include.
Given that, I'll pass on this request, but thanks for the interest! ☕