You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes a bunch of tests to fail with issues similar to this:
self = <CommentSchema(many=False, strict=False)>, args = (), kwargs = {'exclude': (), 'only': ()}
def __init__(self, *args, **kwargs):
self.include_data = kwargs.pop('include_data', ())
super(Schema, self).__init__(*args, **kwargs)
if self.include_data:
self.check_relations(self.include_data)
if not self.opts.type_:
raise ValueError('Must specify type_ class Meta option')
if 'id' not in self.fields:
> raise ValueError('Must have an `id` field')
E ValueError: Must have an `id` field
The text was updated successfully, but these errors were encountered:
mdodsworth
changed the title
fix only with Relationship fields using marshmallow 2.15.1
fix "only with Relationship fields using marshmallow 2.15.1
Apr 27, 2018
mdodsworth
changed the title
fix "only with Relationship fields using marshmallow 2.15.1
fix "only" with Relationship fields using marshmallow 2.15.1
Apr 27, 2018
This change made in Marshmallow 2.15.1 changes behaviour when the caller is passing through
only=()
:marshmallow-code/marshmallow@98f2b47#diff-035365c88325ed9779fcb020f7bcb35a
Previously,
only=()
essentially meant no filtering is applied; after the change,only=()
results in all fields being filtered.Here, we're defaulting the value of
only
to be()
, which then results in all fields being filtered (incl.id
). https://github.com/marshmallow-code/marshmallow-jsonapi/blob/dev/marshmallow_jsonapi/fields.py#L104This causes a bunch of tests to fail with issues similar to this:
The text was updated successfully, but these errors were encountered: