You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have set up the apispec and visited the web page with browser and I found that all swagger static files are 404 not found.
For example, I have set up the apispec like the following snippet, where app is a subapp which is registered to the main app with main_app.add_subapp("/v2/", app).
setup_aiohttp_apispec(app=app, # app is an instance of subapptitle="My Documentation",
version="v2",
url="/docs/swagger.json",
static_path="/static/swagger",
swagger_path="/docs",)
Since the subapp is registered under /v2/, the web page can be visited at http://example.com/v2/docs with swagger_path set to /docs.
But all urls in static files are rendered with absolute path, /static/swagger, which caused 404 since all static files are registered to the subapp, app, under /v2/static/swagger.
Maybe it's better to separate the static path used in the template from the one registered to the app?
That is,
setup_aiohttp_apispec(app=app, # app is an instance of subapptitle="My Documentation",
version="v2",
url="/docs/swagger.json",
static_base_url="/v2/static/swagger", # used in the templatestatic_path="/static/swagger", # used to register the static resourceswagger_path="/docs",)
The text was updated successfully, but these errors were encountered:
Hello, I have set up the apispec and visited the web page with browser and I found that all swagger static files are 404 not found.
For example, I have set up the apispec like the following snippet, where
app
is a subapp which is registered to the main app withmain_app.add_subapp("/v2/", app)
.Since the subapp is registered under
/v2/
, the web page can be visited athttp://example.com/v2/docs
withswagger_path
set to/docs
.But all urls in static files are rendered with absolute path,
/static/swagger
, which caused 404 since all static files are registered to the subapp,app
, under/v2/static/swagger
.aiohttp-apispec/aiohttp_apispec/aiohttp_apispec.py
Line 96 in cf8a921
where
app
is served as the subapp,/v2/
.Maybe it's better to separate the static path used in the template from the one registered to the app?
That is,
The text was updated successfully, but these errors were encountered: