Skip to content

Conversation

pedroimpulcetto
Copy link
Contributor

@pedroimpulcetto pedroimpulcetto commented Oct 2, 2025

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.

Fix #162 issue
Improve and adapt PR #24

Changes

• Dynamic docs URL detection: The CLI now inspects the FastAPI application's docs_url parameter to determine the correct documentation URL
⚠️ Conditional docs display: When docs_url is set to None, the documentation URL is not displayed in the CLI output

Implementation 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

@pedroimpulcetto
Copy link
Contributor Author

hey @svlandeg, as we are stuck with the other PR, I just made the changes to fix #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hard-coded documentation endpoint
1 participant