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

feature: fetch app docs_url #24

Open
wants to merge 14 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
@chipytux
Copy link
Author

chipytux commented May 22, 2024

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

😉 @pedroimpulcetto

@chipytux chipytux changed the title fix: fetch app docs_url feat: fetch app docs_url Jul 25, 2024
@chipytux chipytux changed the title feat: fetch app docs_url feature: fetch app docs_url Aug 15, 2024
@chipytux
Copy link
Author

@tiangolo I do not have permission to configure a label for the PR. https://github.com/fastapi/fastapi-cli/actions/runs/10408815023/job/28827030912?pr=24

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.

3 participants