diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2018-01-26 17:25:59 +0800 |
---|---|---|
committer | yunlong ying <ying.yunlong@zte.com.cn> | 2018-01-27 06:11:31 +0000 |
commit | 429f08a60800bd887f4212843871d6f42c2bdafc (patch) | |
tree | 453c10baa5e9a6a25bbf97a167886292fc342a3e /res | |
parent | 4dcbca178280845675c092db9ba90fc590902fde (diff) |
Add vfc-vnfres auto-swagger baseurl
Change-Id: I6763140313274431a8ec5a3a1057b72e91344994
Issue-ID: VFC-679
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'res')
-rw-r--r-- | res/res/swagger/tests.py | 2 | ||||
-rw-r--r-- | res/res/swagger/urls.py | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/res/res/swagger/tests.py b/res/res/swagger/tests.py index 01eae5a..03bb77f 100644 --- a/res/res/swagger/tests.py +++ b/res/res/swagger/tests.py @@ -25,5 +25,5 @@ class SwaggerViewTest(unittest.TestCase): pass def test_swagger_ok(self): - resp = self.client.get("/swagger.json", format="json") + resp = self.client.get("/api/vnfres/v1/swagger.json", format="json") self.assertEqual(resp.status_code, status.HTTP_200_OK, resp.content) diff --git a/res/res/swagger/urls.py b/res/res/swagger/urls.py index 0cc9043..290ba16 100644 --- a/res/res/swagger/urls.py +++ b/res/res/swagger/urls.py @@ -21,9 +21,9 @@ swagger_info = openapi.Info( default_version='v1', description=""" -The `swagger-ui` view can be found [here](/cached/swagger). -The `ReDoc` view can be found [here](/cached/redoc). -The swagger YAML document can be found [here](/cached/swagger.yaml).""" +The `swagger-ui` view can be found [here](/api/vnfres/v1/cached/swagger). +The `ReDoc` view can be found [here](/api/vnfres/v1/cached/redoc). +The swagger YAML document can be found [here](/api/vnfres/v1/cached/swagger.yaml).""" ) SchemaView = get_schema_view( @@ -34,10 +34,10 @@ SchemaView = get_schema_view( urlpatterns = [ # url(r'^api/vnfres/v1/swagger.json$', SwaggerJsonView.as_view()), - url(r'^swagger(?P<format>.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'^cached/swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=None), name='cschema-json'), - url(r'^cached/swagger/$', SchemaView.with_ui('swagger', cache_timeout=None), name='cschema-swagger-ui'), - url(r'^cached/redoc/$', SchemaView.with_ui('redoc', cache_timeout=None), name='cschema-redoc'), + url(r'^api/vnfres/v1/swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'), + url(r'^api/vnfres/v1/swagger/$', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), + url(r'^api/vnfres/v1/redoc/$', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'), + url(r'^api/vnfres/v1/cached/swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=None), name='cschema-json'), + url(r'^api/vnfres/v1/cached/swagger/$', SchemaView.with_ui('swagger', cache_timeout=None), name='cschema-swagger-ui'), + url(r'^api/vnfres/v1/cached/redoc/$', SchemaView.with_ui('redoc', cache_timeout=None), name='cschema-redoc'), ] |