Modify vnfProducts definition in swagger
[modeling/etsicatalog.git] / catalog / packages / views / pnf_descriptor_views.py
index 9e7a2c4..4051e56 100644 (file)
@@ -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
@@ -33,6 +34,7 @@ from catalog.packages.views.common import validate_data
 from catalog.pub.utils.syscomm import fun_name
 from catalog.pub.utils.values import ignore_case_get
 from .common import view_safe_call_with_log
+from catalog.swagger.views import EtsiCatalogFileAutoSchema
 
 logger = logging.getLogger(__name__)
 
@@ -120,15 +122,18 @@ def pnf_descriptors_rc(request):
     }
 )
 @swagger_auto_schema(
+    auto_schema=EtsiCatalogFileAutoSchema,
     method='GET',
     operation_description="Fetch PNFD content",
     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()
-    }
+    },
+    operation_id='Fetch PNFD content'
 )
 @api_view(http_method_names=['PUT', 'GET'])
 @view_safe_call_with_log(logger=logger)