-
-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Custom Method serialization of List items throws AttributeError #1993
Comments
…ialized by fields.Method.
I still need to get my head around this. I suppose In your example, I don't understand why you use class ExampleSchema(Schema):
dummy_list = fields.Method(serialize="serialize_me")
def serialize_me(self, obj):
return [str(value) for value in obj["dummy_list"]] ? |
@lafrech: That would be also a way to go. However, I wanted to keep the same data types for the field as in the data class. Originally, I discovered the bug in a |
Let's have the following Schema:
Let's have the following serialization code:
ExampleSchema().dump(obj)
throwsAttributeError: 'List' object has no attribute 'serialize_me'
error.The full stack trace is:
The bug exists in marshmallow 3.16.0.
The text was updated successfully, but these errors were encountered: