Skip to content
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

fix: fetch app docs_url #24

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

chipytux
Copy link

@chipytux chipytux commented May 13, 2024

Pull Request Description

Title: Fetch docs_url dynamically from FastAPI app

Description:

This pull request introduces a change to the fastapi-cli library that fetches the docs_url value dynamically from the FastAPI application instead of using a hardcoded value.

Implementation Details:

The change involves modifying the _run function to fetch the docs_url value from the FastAPI application using the app.openapi_url attribute. This ensures that the library always uses the URL specified by the application itself.

Testing:

The updated function has been thoroughly tested to ensure it correctly retrieves the docs_url value from the FastAPI application and show the appropriate URL.

 ╭────────── FastAPI CLI - Development mode ───────────╮                        
 │                                                     │                        
 │  Serving at: http://127.0.0.1:9901                  │                        
 │                                                     │                        
 │  API docs: http://127.0.0.1:9901/any-other-path     │                        
 │                                                     │                        
 │  Running in development mode, for production use:   │                        
 │                                                     │                        
 │  fastapi run                                        │                        
 │                                                     │                        
 ╰─────────────────────────────────────────────────────╯   

@chipytux chipytux changed the title feat: fetch app docs_url fix: fetch app docs_url May 13, 2024
src/fastapi_cli/cli.py Outdated Show resolved Hide resolved
@chipytux
Copy link
Author

chipytux commented May 22, 2024

Do you think this is a good approach @tiangolo ? 🙏🏻

😉 @pedroimpulcetto

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.

None yet

3 participants