Skip to content

Commit

Permalink
Dropped Python 3.6 support
Browse files Browse the repository at this point in the history
Fixed OpenAPI super calls with newer apispec versions
  • Loading branch information
vladmunteanu committed Jul 25, 2022
1 parent ee14a35 commit 12914e6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion starlette_jsonapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.2.0'
__version__ = '2.2.1'
2 changes: 1 addition & 1 deletion starlette_jsonapi/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def fields2jsonschema(self, fields, *, ordered=False, partial=None):
schema_list = [field.parent for field in fields.values()]
if schema_list:
if not isinstance_or_subclass(schema_list[0], JSONAPISchema):
return super().fields2jsonschema(fields, ordered=ordered, partial=partial)
return super().fields2jsonschema(fields, partial=partial)
default_fields = [
('id', None),
('type', {'type': 'string'}),
Expand Down
2 changes: 1 addition & 1 deletion starlette_jsonapi/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async def handle_request(
if request.method not in cls.allowed_methods:
raise JSONAPIException(status_code=405)
resource = cls(request, request_context, *args, **kwargs)
handler = getattr(resource, handler_name, None)
handler = getattr(resource, handler_name)
response = await handler(*args, **kwargs)
except Exception as e:
response = await cls.handle_error(request, request_context, exc=e)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test_jsonapi_response_headers():
resp = JSONAPIResponse()
resp = JSONAPIResponse(content=None)
assert resp.status_code == 200
assert resp.headers['content-type'] == 'application/vnd.api+json'
assert resp.body == b''
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = flake8,mypy,py36,py37,py38,py39
envlist = flake8,mypy,py37,py38,py39,py310
skip_missing_interpreters = true

[testenv]
Expand All @@ -17,8 +17,8 @@ commands = python -m flake8 starlette_jsonapi/ tests/
[testenv:mypy]
basepython = python3
skip_install = true
deps = mypy==0.782
commands = mypy --check-untyped-defs --ignore-missing-imports starlette_jsonapi/ tests/
deps = mypy==0.971
commands = mypy --check-untyped-defs --ignore-missing-imports --install-types --non-interactive starlette_jsonapi/ tests/

[flake8]
max-line-length = 120

0 comments on commit 12914e6

Please sign in to comment.