Skip to content

Commit

Permalink
fix openapi.json path
Browse files Browse the repository at this point in the history
Signed-off-by: Teo Koon Peng <[email protected]>
  • Loading branch information
Teo Koon Peng committed Feb 28, 2024
1 parent 8ef23d7 commit 0e8ef2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/api-server/api_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ async def on_shutdown():

@app.get("/docs", include_in_schema=False)
async def custom_swagger_ui_html():
openapi_url = app.openapi_url if app.openapi_url is not None else "/openapi.json"
openapi_url = (
app.openapi_url
if app.openapi_url is not None
else f"{app_config.public_url.geturl()}/openapi.json"
)
return get_swagger_ui_html(
openapi_url=openapi_url,
title=app.title + " - Swagger UI",
Expand Down

0 comments on commit 0e8ef2d

Please sign in to comment.