I want to specify a marshmallow schema. For one of my fields, I don't want the schema to validate the type, but to simply pass it on. This is because the type could be anything, we don't know ahead of time. I don't see an option in marshmallow.fields
for this. We want to use this as a deserializer.
For example
class FilterSchema(Schema):
op = fields.Str(required=True)
val = fields.**Any**(required=True)
Is there a way to do something like this?
You can use the Raw()
field type.
e.g. val = fields.Raw(required=True)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With