Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while using subapis at mounted swagger js and css #2005

Closed
rodrigoga799 opened this issue Sep 2, 2020 · 2 comments
Closed

Error while using subapis at mounted swagger js and css #2005

rodrigoga799 opened this issue Sep 2, 2020 · 2 comments
Labels
question Question or problem question-migrate

Comments

@rodrigoga799
Copy link

I have use the documentation for mounting the swagger docs as https://fastapi.tiangolo.com/advanced/extending-openapi/
but when I try to mount using this

authAPI = FastAPI(docs_url=None, redoc_url=None)

@authAPI.get("/docs", include_in_schema=False)
app.mount("/api/v1.0/auth" , authAPI , name="authAPI")
async def custom_swagger_ui_html():
return get_swagger_ui_html(
openapi_url=authAPI.openapi_url,
title=authAPI.title + " ENTEL SGIMP ",
oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
swagger_js_url="/static/swagger-ui-bundle.js",
swagger_css_url="/static/swagger-ui.css",
)

the authAPI docs shows are from the openapi.json file not from the authAPI.Why does have this behavior?
Is there any way to fix it ?

main.zip

@rodrigoga799 rodrigoga799 added the question Question or problem label Sep 2, 2020
@rodrigoga799 rodrigoga799 changed the title Error while using subapis at mounted swagger js and csss Error while using subapis at mounted swagger js and css Sep 2, 2020
@ycd
Copy link
Contributor

ycd commented Oct 19, 2020

@rodrigoga799 feel free to edit the question with a proper code formatting, and I do not know what is in the main.zip but if it is main.py and it is too long to paste here, create a gist for it. So others can help with ease.

@tiangolo
Copy link
Owner

tiangolo commented Nov 9, 2022

Thanks for the help @ycd! 🍰

@rodrigoga799 I'll close this issue now, but if you are still having problems, please create a new issue and follow the template form. That will allow us to properly understand your question and help you.

Sorry for the long delay! 🙈 I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.

@tiangolo tiangolo closed this as completed Nov 9, 2022
@tiangolo tiangolo reopened this Feb 28, 2023
Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #7276 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question or problem question-migrate
Projects
None yet
Development

No branches or pull requests

3 participants