Skip to content

Commit

Permalink
Fix the api schema route
Browse files Browse the repository at this point in the history
The issue was that we were mapping all /api/v3/ routes to the api schema
which meant that all routes that didn't match another route displayed
the api schema. It also caused some weird behaviors where we saw some
406s instead of 404. I also needed to move the route above the other
routers because they assigned /api/v3/ to a route which returns a list
of resources.

fixes #3063
https://pulp.plan.io/issues/3063
  • Loading branch information
David Davis authored and daviddavis committed Oct 18, 2017
1 parent 1c80401 commit cfff931
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions platform/pulpcore/app/urls.py
Expand Up @@ -114,10 +114,10 @@ def __repr__(self):
url(r'^api/v3/jwt/', obtain_jwt_token),
]

schema_view = get_schema_view(title='Pulp API')

urlpatterns.append(url(r'^api/v3/$', schema_view))

all_routers = [root_router] + vs_tree.register_with(root_router)
for router in all_routers:
urlpatterns.append(url(r'^api/v3/', include(router.urls)))

schema_view = get_schema_view(title='Pulp API')

urlpatterns.append(url(r'^api/v3/', schema_view))

0 comments on commit cfff931

Please sign in to comment.