Swagger issue fixes from the Ericsson team:content-type extends the "application...
[modeling/etsicatalog.git] / catalog / swagger / views.py
index 33d0edb..93be679 100644 (file)
@@ -17,12 +17,19 @@ import os
 
 from rest_framework.response import Response
 from rest_framework.views import APIView
+from drf_yasg.inspectors import SwaggerAutoSchema
 
 
 class SwaggerJsonView(APIView):
     def get(self, request):
-        json_file = os.path.join(os.path.dirname(__file__), 'vfc.catalog.swagger.json')
+        json_file = os.path.join(os.path.dirname(__file__), 'etsicatalog.swagger.json')
         f = open(json_file)
         json_data = json.JSONDecoder().decode(f.read())
         f.close()
         return Response(json_data)
+
+
+class EtsiCatalogFileAutoSchema(SwaggerAutoSchema):
+    def get_produces(self):
+        super(EtsiCatalogFileAutoSchema, self).get_produces()
+        return ["application/octet-stream", "application/json"]