Open quantoid opened 7 years ago
There are no errors in the logs:
System check identified no issues (0 silenced).
July 04, 2017 - 09:53:14
Django version 1.11.2, using settings 'myservice.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[04/Jul/2017 09:53:33] "GET /doc/ HTTP/1.1" 200 4114
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/css/reset.css HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/jquery-1.8.0.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/css/screen.css HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/jquery.slideto.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/jquery.wiggle.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/css/print.css HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/css/typography.css HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/object-assign-pollyfill.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/jquery.ba-bbq.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/js-yaml.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/handlebars-2.0.0.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/lodash.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/backbone-min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/highlight.9.1.0.pack.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/highlight.9.1.0.pack_extended.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/jsoneditor.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/marked.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/swagger-ui.min.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/lib/swagger-oauth.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/init.js HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /static/rest_framework_swagger/images/logo_small.png HTTP/1.1" 304 0
[04/Jul/2017 09:53:33] "GET /doc/?format=openapi HTTP/1.1" 200 9225
Took a long process of elimination to work out that it was the route name!
What did you have to do to fix the problem? I'm having the same problem ...
Thanks
I changed the name of the route from "definitions" to "patterns".
router.register("patterns", views.DefinitionViews) # this fixes SwaggerUI
Anything other than "definitions" seems to work.
Given I have an API with a bunch of routes including a "definitions" route that all go to a
ModelViewSet
that use aHyperlinkedModelSerializer
When I add a SwaggerUI route and view it Then I get no SwaggerUI usingget_swagger_view
unless I comment out the "definitions" routeIf there's something special about the "definitions" route I couldn't find it in the doco, other than there being a "definitions" section in a Swagger spec.