-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
afabiani
committed
Dec 2, 2020
1 parent
7c842d0
commit 399b420
Showing
7 changed files
with
42 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,13 @@ | |
######################################################################### | ||
from tastypie.api import Api | ||
from dynamic_rest import routers | ||
from drf_spectacular.views import ( | ||
SpectacularAPIView, | ||
SpectacularRedocView, | ||
SpectacularSwaggerView | ||
) | ||
|
||
from rest_framework import permissions | ||
from drf_yasg.views import get_schema_view | ||
from drf_yasg import openapi | ||
from django.conf.urls import url | ||
from django.urls import path | ||
|
||
from . import api as resources | ||
from . import resourcebase_api as resourcebase_resources | ||
|
@@ -48,21 +50,8 @@ | |
|
||
router = routers.DynamicRouter() | ||
|
||
schema_view = get_schema_view( | ||
openapi.Info( | ||
title="GeoNode REST API", | ||
default_version='v2', | ||
description="Application for serving and sharing geospatial data", | ||
terms_of_service="https://github.com/GeoNode/geonode/wiki/Community-Bylaws", | ||
contact=openapi.Contact(email="[email protected]"), | ||
license=openapi.License(name="GPL License"), | ||
), | ||
public=True, | ||
permission_classes=(permissions.AllowAny,), | ||
) | ||
|
||
urlpatterns = [ | ||
url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), | ||
url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), | ||
url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), | ||
path('schema/', SpectacularAPIView.as_view(), name='schema'), | ||
path('schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'), | ||
path('schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters