Skip to content

Commit

Permalink
Use UrlPathVersioning for schema view
Browse files Browse the repository at this point in the history
  • Loading branch information
lundberg committed Apr 4, 2019
1 parent 42939cc commit 6e619a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bananas/admin/api/schemas/yasg.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from rest_framework.authentication import SessionAuthentication
from rest_framework.routers import SimpleRouter
from rest_framework.schemas.generators import is_custom_action
from rest_framework.versioning import URLPathVersioning

from ..versioning import BananasVersioning
from .base import BananasBaseRouter
Expand Down Expand Up @@ -104,7 +105,7 @@ def is_navigation(self):

class BananasSimpleRouter(BananasBaseRouter, SimpleRouter):
def get_schema_view(self):
return get_schema_view(
view = get_schema_view(
openapi.Info(
title="Django Bananas Admin API Schema",
default_version=BananasVersioning.default_version,
Expand All @@ -119,3 +120,5 @@ def get_schema_view(self):
permission_classes=(permissions.AllowAny,),
patterns=self.urls,
)
view.versioning_class = URLPathVersioning
return view

0 comments on commit 6e619a3

Please sign in to comment.