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
When building the url_name in the swagger and redoc views, reverse uses the current request in the context. If we run our project locally, that would be localhost in the app container but localhost:port_number for the instance outside the app container:
To reproduce, install drf-spectacular v0.9.7 or above and go to your project's doc page on localhost e.g. localhost:8030/mydocs/redoc/. The following error will show up (notice the missing port number in the request):
Error downloading http://localhost/docs/schema/ Failed to fetch
Stack trace
Error: Error downloading http://localhost/docs/schema/
Failed to fetch
at https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:63:6628
at https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js:122:36080
TypeError: Failed to fetch
ReDoc Version: 2.0.0-rc.30
Commit: 5bace30
When using v0.9.6 the normal response is rendered successfully.
The text was updated successfully, but these errors were encountered:
that was an unintended side effect of a previous change to versioning.
plain reverse generates a relative URL. reverse with the request parameter generates an absolute URL. unfortunately, the request is required to make the versioning work correctly.
since that might be hard to some or they have no access to the reverse proxy config, i added a url param to the view which takes precedence over url_name. note however that schema versioning will not work there anymore. it's a compromise.
When building the
url_name
in the swagger and redoc views,reverse
uses the current request in the context. If we run our project locally, that would belocalhost
in the app container butlocalhost:port_number
for the instance outside the app container:{'url_name': reverse(self.url_name, request=request)},
To reproduce, install drf-spectacular v0.9.7 or above and go to your project's doc page on localhost e.g.
localhost:8030/mydocs/redoc/
. The following error will show up (notice the missing port number in the request):When using v0.9.6 the normal response is rendered successfully.
The text was updated successfully, but these errors were encountered: