Code Review
/
modeling
/
etsicatalog.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Swagger issue fixes from the Ericsson team:content-type extends the "application...
[modeling/etsicatalog.git]
/
catalog
/
swagger
/
views.py
diff --git
a/catalog/swagger/views.py
b/catalog/swagger/views.py
index
4739188
..
93be679
100644
(file)
--- a/
catalog/swagger/views.py
+++ b/
catalog/swagger/views.py
@@
-17,6
+17,7
@@
import os
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.views import APIView
+from drf_yasg.inspectors import SwaggerAutoSchema
class SwaggerJsonView(APIView):
class SwaggerJsonView(APIView):
@@
-26,3
+27,9
@@
class SwaggerJsonView(APIView):
json_data = json.JSONDecoder().decode(f.read())
f.close()
return Response(json_data)
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"]