-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Union field #1191
Comments
There isn't a built-in union field at the moment, and we don't have plans to add one in the near future. Since we won't get to this soon, I'm going to close this issue for now. If you end up developing this as a separate package, please comment here and add it to the wiki: https://github.com/marshmallow-code/marshmallow/wiki/Ecosystem |
Here's an implementation. https://github.com/adamboche/python-marshmallow-union |
What's the recommended way of implementing this with marshmallow? |
Can't seem to find this anywhere, but a field that allows an incoming value to be matched across several different types/fields would be pretty handy.
Example could be something like this:
Where if it failed to validate against the first field, it'd go through the rest of the fields provided until it finds one it matches, otherwise raising an error.
The text was updated successfully, but these errors were encountered: