From 0f456e5c4dec5fd66fc0f4a773043dd74ef789d0 Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Fri, 13 Apr 2018 10:37:30 +0800 Subject: [PATCH] Fix vfc-catalog auto swagger url Change-Id: I44bd754174b68e479bb5170a8beb1c4c21d70c12 Issue-ID: VFC-877 Signed-off-by: ying.yunlong --- catalog/swagger/urls.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/catalog/swagger/urls.py b/catalog/swagger/urls.py index 146cb040..5437ee5a 100644 --- a/catalog/swagger/urls.py +++ b/catalog/swagger/urls.py @@ -17,18 +17,16 @@ from drf_yasg import openapi from drf_yasg.views import get_schema_view from rest_framework import permissions -from catalog.swagger.views import SwaggerJsonView - # Add code for generating swagger automatically. swagger_info = openapi.Info( title="VFC Catalog API", default_version='v1', description=""" -The `swagger-ui` view can be found [here](/api/vnflcm/v1/swagger). -The `ReDoc` view can be found [here](/api/vnflcm/v1/redoc). -The swagger YAML document can be found [here](/api/vnflcm/v1/swagger.yaml). -The swagger JSON document can be found [here](/api/vnflcm/v1/swagger.json).""" +The `swagger-ui` view can be found [here](/api/catalog/v1/swagger). +The `ReDoc` view can be found [here](/api/catalog/v1/redoc). +The swagger YAML document can be found [here](/api/catalog/v1/swagger.yaml). +The swagger JSON document can be found [here](/api/catalog/v1/swagger.json).""" ) SchemaView = get_schema_view( @@ -38,8 +36,8 @@ SchemaView = get_schema_view( ) urlpatterns = [ - url(r'^api/catalog/v1/swagger.json$', SwaggerJsonView.as_view()), - url(r'^swagger(?P.json|.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'), - url(r'^swagger/$', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), - url(r'^redoc/$', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'), + # url(r'^api/catalog/v1/swagger.json$', SwaggerJsonView.as_view()), + url(r'^api/catalog/v1/swagger(?P.json|.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'), + url(r'^api/catalog/v1/swagger$', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), + url(r'^api/catalog/v1/redoc$', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'), ] -- 2.16.6