diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index f006456d..750621c7 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] fail-fast: false steps: - uses: actions/checkout@v2 diff --git a/.travis.yml b/.travis.yml index 83226eb0..aaf6e009 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: python sudo: false matrix: include: - - python: 3.5 - python: 3.6 - python: 3.7 - python: 3.8 diff --git a/openapi_core/deserializing/media_types/factories.py b/openapi_core/deserializing/media_types/factories.py index f5bce1fe..76cf402d 100644 --- a/openapi_core/deserializing/media_types/factories.py +++ b/openapi_core/deserializing/media_types/factories.py @@ -1,5 +1,7 @@ +from json import loads + from openapi_core.deserializing.media_types.util import ( - json_loads, urlencoded_form_loads, data_form_loads, + urlencoded_form_loads, data_form_loads, ) from openapi_core.deserializing.media_types.deserializers import ( @@ -10,7 +12,7 @@ class MediaTypeDeserializersFactory(object): MEDIA_TYPE_DESERIALIZERS = { - 'application/json': json_loads, + 'application/json': loads, 'application/x-www-form-urlencoded': urlencoded_form_loads, 'multipart/form-data': data_form_loads, } diff --git a/openapi_core/deserializing/media_types/util.py b/openapi_core/deserializing/media_types/util.py index 195d00c5..5b326b21 100644 --- a/openapi_core/deserializing/media_types/util.py +++ b/openapi_core/deserializing/media_types/util.py @@ -1,15 +1,7 @@ from email.parser import Parser -from json import loads from urllib.parse import parse_qsl -def json_loads(value): - # python 3.5 doesn't support binary input fix - if isinstance(value, (bytes, )): - value = value.decode() - return loads(value) - - def urlencoded_form_loads(value): return dict(parse_qsl(value)) diff --git a/setup.cfg b/setup.cfg index f18bf7e1..67f4cc8b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,7 +9,7 @@ classifiers = Intended Audience :: Developers Topic :: Software Development :: Libraries :: Python Modules Operating System :: OS Independent - Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 @@ -21,7 +21,7 @@ include_package_data = True packages = find: zip_safe = False test_suite = tests -python_requires = >= 3.5 +python_requires = >= 3.6 setup_requires = setuptools install_requires =