-
-
Notifications
You must be signed in to change notification settings - Fork 69
add support to dynamic url docs based on the FastAPI docs_url param #221
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?
add support to dynamic url docs based on the FastAPI docs_url param #221
Conversation
|
Just enountered this bug, it would be great to merge this fix 🙌🏻 |
|
This pull request has a merge conflict that needs to be resolved. |
4d7462c to
a97e937
Compare
|
hey @patrick91 @tiangolo, what are your thoughts about it? we would love to get it in |
|
Hi @pedroimpulcetto! 👋 I'm testing and reviewing this PR as part of my contribution to resolving #162. Initial Review:
Testing Plan:
I'll share detailed findings and any edge cases I discover. Great work on this implementation! 🚀 |
This PR adds support for dynamically displaying the correct documentation URL in the CLI output based on the FastAPI application's docs_url parameter configuration.
Fixes #162 issue
Improve and adapt PR #24
Changes
• Dynamic docs URL detection: The CLI now inspects the FastAPI application's⚠️ Conditional docs display: When
docs_urlparameter to determine the correct documentation URL•
docs_urlis set to None, the documentation URL is not displayed in the CLI outputImplementation Details
• Added _get_url_docs() function to extract the docs_url from the FastAPI application instance
• Modified the server startup output to conditionally display documentation URL based on the docs_url parameter
• Updated both dev and run commands to support dynamic URL detection
Testing
Added comprehensive test coverage for:
• Applications with custom docs_url paths
• Applications with docs_url=None (disabled docs)
• Applications with both custom docs_url and root_path
• Both dev and run command modes
• Various host and port configurations