MCPcopy
hub / github.com/marshmallow-code/marshmallow / _serialize

Method _serialize

src/marshmallow/fields.py:623–630  ·  view source on GitHub ↗
(self, nested_obj, attr, obj, **kwargs)

Source from the content-addressed store, hash-verified

621 ]
622
623 def _serialize(self, nested_obj, attr, obj, **kwargs):
624 # Load up the schema first. This allows a RegistryError to be raised
625 # if an invalid schema name was passed
626 schema = self.schema
627 if nested_obj is None:
628 return None
629 many = schema.many or self.many
630 return schema.dump(nested_obj, many=many)
631
632 def _test_collection(self, value: typing.Any) -> None:
633 many = self.schema.many or self.many

Callers

nothing calls this directly

Calls 1

dumpMethod · 0.80

Tested by

no test coverage detected