Deprecations/Removals:
- Drop support for marshmallow 2, which is now EOL (
332
).
Bug fixes:
- Fix behavior when serializing
None
(302
). Thanksmahenzon
.
Other changes:
- Test against Python 3.8 and 3.9 (
332
).
Bug fixes:
- Import from collections.abc for forward-compatibility with Python 3.10 (
318
). Thankstirkarthi
.
Bug fixes:
- Fix nested fields validation error formatting (
120
). Thanksmahenzon
anddebonzi
for the PRs.
- Improve performance of link generation from Relationship (
277
). Thanksiamareebjamal
for reporting and fixing.
Deprecation/Removals:
- Drop support for Python 2.7 and 3.5. Only Python>=3.6 is supported (
251
). - Drop support for marshmallow 3 pre-releases. Only stable versions >=2.15.2 are supported.
- Remove
fields.Meta
.
Bug fixes:
- Address
DeprecationWarning
raised byField.fail
on marshmallow 3.
Bug fixes:
- marshmallow 3.0.0rc7 compatibility (
233
).
Other changes:
- Format with pyupgrade and black (
235
). - Switch to Azure Pipelines for CI (
234
).
Bug fixes:
- marshmallow 3.0.0rc6 cmpatibility (
221
).
Bug fixes:
- Backwards-incompatible: Revert URL quoting introduced in 0.20.2 (
184
). If you need quoting, override Schema.generate_url.
from marshmallow_jsonapi import Schema
from werkzeug.urls import url_fix
class MySchema(Schema):
def generate_url(self, link, **kwargs):
url = super().generate_url(link, **kwargs)
return url_fix(url)
Thanks kgutwin
for reporting the issue.
- Fix Relationship deserialization behavior when
required=False
(177
). Thanksaberres
for reporting andscottwernervt
for the fix.
Other changes:
- Test against Python 3.7.
Bug fixes:
- Fix deserializing
id
field to non-string types (179
). Thanksaberres
for the catch and patch.
Bug fixes:
- Fix bug where multi-level nested relationships would not be properly deserialized (
127
). Thanksww3pl
for the catch and patch.
Bug fixes:
- Fix missing load validation when data is not a collection but many=True (
161
). ThanksgrantHarris
.
Bug fixes:
- Fix issues where generated URLs are unquoted (
147
). ThanksgrantHarris
.
Other changes:
- Fix tests against marshmallow 3.0.0b13.
Bug fixes:
- Fix deserializing
missing
with a Relationship field (130
). Thankskumy
for the catch and patch.
Bug fixes:
- Fix serialization of
id
forRelationship
fields whenattribute
is set (69
). Thanksjordal
for reporting and thanksscottwernervt
for the fix.
Note: The above fix could break some code that set Relationship.id_field
before instantiating it. Set Relationship.default_id_field
instead.
# before
fields.Relationship.id_field = "item_id"
# after
fields.Relationship.default_id_field = "item_id"
Support:
- Test refactoring and various doc improvements (
63
,86
,121,
and122
). Thanksscottwernervt
.
Features:
- Schemas passed to
fields.Relationship
will inherit context from the parent schema (84
). Thanksasteinlein
andscottwernervt
for the PRs.
Features:
- Add
fields.ResourceMeta
for serializing a resource-level meta object (107
). Thanksscottwernervt
.
Other changes:
- Backwards-incompatible: Drop official support for Python 3.4.
Features:
- Add support for marshmallow 3 (
97
). Thanksrockmnew
. - Thanks
mdodsworth
for helping with101
. - Move meta information object to document top level (
95
). Thanksscottwernervt
.
Features:
- Add support for exluding or including nested fields on relationships (
94
). Thanksscottwernervt
for the PR.
Other changes:
- Backwards-incompatible: Drop support for marshmallow<2.8.0
Bug fixes:
- Fix pointer for
id
in error objects (90
). Thanksrgant
for the catch and patch.
Features:
Relationship
field supports deserializing included data (83
). Thanksanuragagarwal561994
for the suggestion and thanksasteinlein
for the PR.
Features:
Relationship
respects its passedSchema's
get_attribute
method when getting theid
field for resource linkages (80
). Thanksscmmmh
for the PR.
Features:
- Add support for including deeply nested relationships in compount documents (
61
). Thanksmrhanky17
for the PR.
Features:
- Use default attribute value instead of raising exception if relationship is
None
onRelationship
field (75
). Thanksakira-dev
.
Bug fixes:
- Fix formatting JSON pointer when serializing an invalid object at index 0 (
77
). Thanksdanpoland
for the catch and patch.
Bug fixes:
- Fix compatibility with marshmallow 3.x.
Other changes:
- Backwards-incompatible: Remove unused utils.get_value_or_raise function.
Bug fixes:
- Fix format of error object returned when
data
key is not included in input (66
). ThanksRazerM
. - Fix serializing compound documents when
Relationship
is passed a schema class andmany=True
(67
). Thanksdanpoland
for the catch and patch.
Bug fixes:
- Serialize
None
and empty lists ([]
) to valid JSON-API objects (58
). Thanksrgant
for reporting and sending a PR.
Features:
- Add
fields.Meta
for (de)serializingmeta
data on resource objects (28
). Thanksrubdos
for the suggestion and initial work. ThanksRazerM
for the PR.
Other changes:
- Test against Python 3.6.
Features:
- Add Flask-specific schema with class Meta options for self link generation:
self_view
,self_view_kwargs
, andself_view_many
(51
). Thanksasteinlein
.
Bug fixes:
- Fix formatting of validation error messages on newer versions of marshmallow.
Other changes:
- Drop official support for Python 3.3.
Features:
- Add support for compound documents (
11
). ThanksTim-Erwin
andwoodb
for implementing this. - Backwards-incompatible: Remove
include_data
parameter fromRelationship
. Useinclude_resource_linkage
instead.
Bug fixes:
- Format correction for error objects (
47
). ThanksZeeD26
for the PR.
Features:
- Correctly format
messages
attribute ofValidationError
raised whentype
key is missing in input (43
). ThanksZeeD26
for the catch and patch. - JSON pointers for error objects for relationships will point to the
data
key (41
). Thankscmanallen
for the PR.
Features:
Relationship
deserialization improvements: properly validate to-one and to-many relatinoships and validate the presense of thedata
key (37
). Thankscmanallen
for the PR.attributes
is no longer a required key in thedata
object (#39
,42
). ThanksZeeD26
for reporting andcmanallen
for the PR.- Added
id
serialization (39
). Thanks againcmanallen
.
Features:
- Add relationship deserialization (
15
). - Allow serialization of foreign key attributes (
32
). - Relationship IDs serialize to strings, as is required by JSON-API (
31
). Relationship
field respectsdump_to
parameter (33
).
Thanks cmanallen
for all of these changes.
Other changes:
- The minimum supported marshmallow version is 2.3.0.
Bug fixes:
- Relationship names are inflected when appropriate (
22
). Thanksangelosarto
for reporting.
Bug fixes:
- Fix serializing null and empty relationships with
flask.Relationship
(24
). Thanksfloqqi
for the catch and patch.
- Correctly serialize null and empty relationships (
10
). Thanksjo-tham
for the PR. - Add
self_url
,self_url_kwargs
, andself_url_many
class Meta options for addingself
links. Thanksasteinlein
for the PR.
- Backwards-incompatible: Replace
HyperlinkRelated
withRelationship
field. Supports related links (related
), relationship links (self
), and resource linkages. - Backwards-incompatible: Validate and deserialize JSON API-formatted request payloads.
- Fix error formatting when
many=True
. - Fix error formatting in strict mode.
- Fix for marshmallow 2.0.0 compat.
- Compatibility with marshmallow>=2.0.0rc2.
Features:
- Add framework-independent
HyperlinkRelated
field. - Support inflection of attribute names via the
inflect
class Meta option.
Bug fixes:
- Fix for making
HyperlinkRelated
read-only by defualt.
Support:
- Docs updates.
- Tested on Python 3.5.
- First PyPI release.
- Include Schema that serializes objects to resource objects.
- Flask-compatible HyperlinkRelate field for serializing relationships.
- Errors are formatted as JSON API errror objects.