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
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__)
}
)
@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)