Improve handling of consumes and produces attributes (#55)

* Fix get_consumes
* Generate produces for Operation
* Set global consumes and produces from rest framework DEFAULT_ settings
This commit is contained in:
Cristi Vîjdea
2018-01-24 14:44:00 +02:00
committed by GitHub
parent a46b684fea
commit a3e81ef7f6
6 changed files with 93 additions and 65 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ from djangorestframework_camel_case.parser import CamelCaseJSONParser
from djangorestframework_camel_case.render import CamelCaseJSONRenderer
from inflection import camelize
from rest_framework import generics
from rest_framework.parsers import FormParser
from drf_yasg import openapi
from drf_yasg.inspectors import SwaggerAutoSchema
@@ -21,7 +22,7 @@ class SnippetList(generics.ListCreateAPIView):
queryset = Snippet.objects.all()
serializer_class = SnippetSerializer
parser_classes = (CamelCaseJSONParser,)
parser_classes = (FormParser, CamelCaseJSONParser,)
renderer_classes = (CamelCaseJSONRenderer,)
swagger_schema = CamelCaseOperationIDAutoSchema