🐛 Fix hardcoded docs URL#386
Open
YuriiMotov wants to merge 11 commits intomainfrom
Open
Conversation
FlavienRx
reviewed
Apr 28, 2026
FlavienRx
reviewed
Apr 28, 2026
| ] | ||
| if docs_links: | ||
| toolkit.print( | ||
| f"Documentation at {docs_links[0]}", |
Contributor
There was a problem hiding this comment.
Why do you create a list of url and just print the first ? What about swagger and redoc urls ?
Member
Author
There was a problem hiding this comment.
I decided to keep it closer to the current behavior (only Swagger docs link is shown).
But I was in doubts about whether we should limit it to only first link or show all of them.
I actually wanted to highlight this in the comments, but forgot. So, thanks for pointing to it!)
I personally think that showing only one link is OK, and there is no big difference where to drop others (I mean whether to return all links from get_docs_utls or to return the only one that should be shown).
Let's wait for Sebastian to take a look and decide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #162
FastAPI allows configuring the docs URLs, but
fastapi-clicurrently doesn't respect it:(docs URL should be
http://0.0.0.0:8000/api/swagger_docs)This PR fixes this.
Use cases:
openapi_url=Nonedocs_url=None, Redoc docs URL will be shownroot_pathspecified as an option tofastapi run\devcommand or as a parameter toFastAPIWith this fix:
See also #381 that solves the issue with docs being unreachable via links due to
0.0.0.0in host addressThis PR is based on #119, credits to @FlavienRx