File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
openapi_core/schema/media_types Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11"""OpenAPI core media types models module"""
22from collections import defaultdict
33
4- from json import loads
5-
64from openapi_core .schema .media_types .exceptions import InvalidMediaTypeValue
5+ from openapi_core .schema .media_types .util import json_loads
76from openapi_core .schema .schemas .exceptions import (
87 CastError , ValidateError ,
98)
109from openapi_core .unmarshalling .schemas .exceptions import UnmarshalError
1110
1211
1312MEDIA_TYPE_DESERIALIZERS = {
14- 'application/json' : loads ,
13+ 'application/json' : json_loads ,
1514}
1615
1716
Original file line number Diff line number Diff line change 1+ from json import loads
2+
3+ from six import binary_type
4+
5+
6+ def json_loads (value ):
7+ # python 3.5 doesn't support binary input fix
8+ if isinstance (value , (binary_type , )):
9+ value = value .decode ()
10+ return loads (value )
You can’t perform that action at this time.
0 commit comments