-
Notifications
You must be signed in to change notification settings - Fork 35
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
refactor: move Swagger UI to root path #665
Conversation
- Move Swagger UI from /docs to root path (/) - Relocate root health check to /health endpoint - Add redirect from /docs to / for backward compatibility - Disable Redoc UI Co-Authored-By: Benjamin Bolte <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
www/app/main.py
Outdated
@app.get("/docs", include_in_schema=False) | ||
async def docs_redirect() -> RedirectResponse: | ||
"""Redirect /docs to the root path where Swagger UI is now served.""" | ||
return RedirectResponse(url="/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove this i think
www/app/main.py
Outdated
@app.get("/") | ||
async def read_root() -> bool: | ||
@app.get("/health") | ||
async def health_check() -> bool: | ||
"""Health check endpoint that returns True if the service is running.""" | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, we can just delete this and use /docs for health checks
www/app/main.py
Outdated
docs_url="/", # New location for Swagger UI | ||
redoc_url=None, # Disable Redoc UI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the comments, and add back the redoc url from before
…direct) Co-Authored-By: Benjamin Bolte <[email protected]>
Move Swagger UI to Root Path
This PR moves the Swagger UI from
/docs
to the root path (/
), improving API documentation accessibility.Changes
/docs
to root path (/
)/health
endpoint with improved documentation/docs
to/
for backward compatibilityNotes
make lint
andmake test
steps/
)Testing
make lint
)/health
endpoint returning true/docs
redirecting to rootLink to Devin run: https://app.devin.ai/sessions/acedfbfec89b44af8bf3b190b1f01502