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

SpectacularAPIView return yaml by default please change at next build for redoc implement. #363

Closed
bboyadao opened this issue Apr 9, 2021 · 3 comments

Comments

@bboyadao
Copy link

bboyadao commented Apr 9, 2021

I got an error.
Screen Shot 2021-04-09 at 16 42 16

Then i found this on template.
Screen Shot 2021-04-09 at 16 42 28
I add format query then it's work. But i don't think this is the good way
Screen Shot 2021-04-09 at 16 42 48

@bboyadao
Copy link
Author

bboyadao commented Apr 9, 2021

Oh i think document should change

from drf_spectacular.views import SpectacularRedocView, SpectacularSwaggerView, SpectacularJSONAPIView

urlpatterns += [
    # YOUR PATTERNS
    path('api/schema/', SpectacularJSONAPIView.as_view(), name='schema'),
    # Optional UI:
    path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
    path('api/schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'),
]

Thanks!

@tfranzel
Copy link
Owner

tfranzel commented Apr 9, 2021

hi @bboyadao, very interesting. this has worked flawlessly for a long time, but i have not tested it recently. their README says this:

specOrSpecUrl is either JSON object with specification or an URL to the spec in JSON or YAML format

so this should work for the default YAML response. i will have a look. its either an upstream bug or they changed their interface.

@tfranzel
Copy link
Owner

redoc released v2.0.0-rc.52 which fixes the regression.

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

No branches or pull requests

2 participants