diff options
author | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-11-27 10:49:38 +0800 |
---|---|---|
committer | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-11-27 10:55:14 +0800 |
commit | 8bd492a4918a6692d36f1e1e766c7e3a88e56084 (patch) | |
tree | 028fb66f965346be4a3d3fe8d35c825e60dacd0e /catalog/packages/views/pnf_descriptor_views.py | |
parent | b301e35367f860fae335c85227795008b531d79b (diff) |
Swagger issue fixes from the Ericsson team
Change-Id: I4fb7609292101e9c0c44b38ec8d40657bd340460
Issue-ID: MODELING-288
Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
Diffstat (limited to 'catalog/packages/views/pnf_descriptor_views.py')
-rw-r--r-- | catalog/packages/views/pnf_descriptor_views.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/catalog/packages/views/pnf_descriptor_views.py b/catalog/packages/views/pnf_descriptor_views.py index 9e7a2c4..1fa03dc 100644 --- a/catalog/packages/views/pnf_descriptor_views.py +++ b/catalog/packages/views/pnf_descriptor_views.py @@ -19,6 +19,7 @@ from drf_yasg.utils import no_body, swagger_auto_schema from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response +from drf_yasg import openapi from catalog.packages.biz.pnf_descriptor import PnfDescriptor from catalog.packages.const import TAG_PNFD_API, TAG_PARSER_API @@ -125,10 +126,13 @@ def pnf_descriptors_rc(request): tags=[TAG_PNFD_API], request_body=no_body, responses={ - status.HTTP_204_NO_CONTENT: 'PNFD file', + status.HTTP_200_OK: openapi.Response('PNFD file', schema=openapi.Schema(format=openapi.FORMAT_BINARY, + type=openapi.TYPE_STRING)), status.HTTP_404_NOT_FOUND: ProblemDetailsSerializer(), status.HTTP_500_INTERNAL_SERVER_ERROR: ProblemDetailsSerializer() - } + }, + produces='application/octet-stream', + operation_id='Fetch PNFD content' ) @api_view(http_method_names=['PUT', 'GET']) @view_safe_call_with_log(logger=logger) |