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
I've narrowed this issue down to https://github.com/marshmallow-code/marshmallow/blob/dev/src/marshmallow/fields.py#L601 where the self.only values in the instantiated BSchema() will be "b.a2" whereas original = self._schema.fields.keys() will be the top-level parent "b". This results in an empty set intersection meaning the serialized value will have no fields.
The text was updated successfully, but these errors were encountered:
i agree this is a bug since we currently support passing only to Nested with a schema instance, but i wonder if it's something we should drop going forward? it's a bit odd to allow schema kwargs to Nested when they can be passed to the Schema ctor itself 🤔
Related to #2164
The following works as intended
Outputting
However when changing the CSchema nested field
c
lambda to return an instantiatedBSchema()
, the output is different and incorrectOutputs
I've narrowed this issue down to https://github.com/marshmallow-code/marshmallow/blob/dev/src/marshmallow/fields.py#L601 where the
self.only
values in the instantiatedBSchema()
will be"b.a2"
whereasoriginal = self._schema.fields.keys()
will be the top-level parent"b"
. This results in an empty set intersection meaning the serialized value will have no fields.The text was updated successfully, but these errors were encountered: