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
This raises marshmallow.exceptions.ValidationError: {'color': ['Must be one of: RED, GREEN, BLUE.']}
If I define a Enum field explicitly on ItemSchema:
color=ma.fields.Enum(ColorEnum)
It loads correctly.
Also works if I define the enum using sa.Enum with strings on Item:
color=sa.Column(sa.Enum("RED", "GREEN", "BLUE"))
After #611, if I understood correctly, I shouldn't need to define the field explicitly, or is there something I'm missing?
Thank you!
The text was updated successfully, but these errors were encountered:
joaquimvl
changed the title
marhsmallow auto generated field using enum.Enum raises error when on load
marhsmallow auto generated field using enum.Enum raises error on load
Aug 22, 2024
Hi,
When I define SQLAlchemy columns using
enum.Enum
the auto generated marshmallow field fails validation when I try to load:This raises
marshmallow.exceptions.ValidationError: {'color': ['Must be one of: RED, GREEN, BLUE.']}
If I define a Enum field explicitly on
ItemSchema
:It loads correctly.
Also works if I define the enum using
sa.Enum
with strings onItem
:After #611, if I understood correctly, I shouldn't need to define the field explicitly, or is there something I'm missing?
Thank you!
The text was updated successfully, but these errors were encountered: