-
-
Notifications
You must be signed in to change notification settings - Fork 61
🧑💻 Add conditional printing API docs URLs in panel #119
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
base: main
Are you sure you want to change the base?
Conversation
hi |
Hi @sehraramiz You right, I started to refactor my code but I run out of time to finish and push my code 😄 |
f45dccf
to
9f95bd6
Compare
I did the job, let me know what do you think. @tiangolo, what do you think about this feature ? |
A new label has to be added:
|
This resolves #162 |
Would this work if I disable the URLs entirely? app = FastAPI(
lifespan=lifespan,
docs_url="/docs" if DEV_MODE else None,
redoc_url="/redoc" if DEV_MODE else None,
openapi_url="/openapi.json" if DEV_MODE else None
) |
@eden881 Yep, I had some tests to test this case. |
Description:
This PR refactors the FastAPI server start-up logic to improve the display of the application’s documentation URLs in the console. It introduces a conditional check for app.openapi_url, ensuring that only defined documentation URLs are printed. The updated logic adds more flexibility to display either docs_url, redoc_url, or both, enhancing visibility for users when serving the API.
Changes:
This adjustment improves user experience by making API documentation links visible and accessible only when they are set.
Examples:


