Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 1.4.2 (unreleased)
## 1.5.0 (unreleased)
---------------------

- Nothing changed yet.
- Support marshmallow 4.0 and switch to marshmallow-jsonapi-minfork.
- Return JSON:API errors when schema serialization raises TypeError.


## 1.4.1 (2026-02-02)
Expand Down
4 changes: 2 additions & 2 deletions base_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask
marshmallow>=3.0.0,<4.0.0
marshmallow_jsonapi
marshmallow>=4.0.0
marshmallow-jsonapi-minfork
4 changes: 2 additions & 2 deletions flask_jsonapi/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get(self, *args, **kwargs):
data = self.schema(include_data=include_fields, only=sparse_fields).dump(resource)
except marshmallow.ValidationError as e:
raise exceptions.JsonApiException(detail='marshmallow.ValidationError', source=e.messages)
except (AttributeError, KeyError, ValueError) as e:
except (AttributeError, KeyError, TypeError, ValueError) as e:
logger.error(
'Error Processing Request',
extra={'status_code': http.HTTPStatus.BAD_REQUEST, 'request': request, 'exception': e}
Expand Down Expand Up @@ -134,7 +134,7 @@ def get(self, *args, **kwargs):
many=True, include_data=include_fields, only=sparse_fields).dump(objects_list)
except marshmallow.ValidationError as e:
raise exceptions.JsonApiException(detail='marshmallow.ValidationError', source=e.messages)
except (AttributeError, KeyError, ValueError) as e:
except (AttributeError, KeyError, TypeError, ValueError) as e:
logger.error(
'Error Processing Request',
extra={'status_code': http.HTTPStatus.BAD_REQUEST, 'request': request, 'exception': e}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_long_description():

setup(
name='flask-jsonapi',
version='1.4.2.dev0',
version='1.5.0.dev0',
description='JSONAPI 1.0 implementation for Flask.',
long_description=get_long_description(),
long_description_content_type='text/markdown',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_bad_data_get_list(app):
)
result = json.loads(response.data.decode('utf-8'))
assert result['errors'][0]['status'] == 500
assert result['errors'][0]['detail'] == "'int' object has no attribute 'isoformat'"
assert 'isoformat' in result['errors'][0]['detail']


def test_bad_data_get_detail(app):
Expand All @@ -160,7 +160,7 @@ def test_bad_data_get_detail(app):
)
result = json.loads(response.data.decode('utf-8'))
assert result['errors'][0]['status'] == 500
assert result['errors'][0]['detail'] == "'int' object has no attribute 'isoformat'"
assert 'isoformat' in result['errors'][0]['detail']


def test_create_with_missing_data(app):
Expand Down
Loading