test_obj = type("TestEnumObj", (Model,), {"_attribute_map":None})
test_obj._attribute_map = {
"abc":{"key":"ABC", "type":"TestEnum"}
}
class TestEnum(Enum):
val = "Value"
class TestEnum2(Enum):
val2 = "Value2"
t = test_obj
t.abc = TestEnum2.val2
serializer = Serializer({
'TestEnum': TestEnum,
'TestEnum2': TestEnum2
})
serializer._serialize(t) # Should fail
Currently there is no type check, it just looks like an enum and we are happy. We should check if it's the correct enum, or least that the value is consistent.
Currently, the server will fail with probably a more complexe error message to handle that we can do
Example:
Currently there is no type check, it just looks like an enum and we are happy. We should check if it's the correct enum, or least that the value is consistent.
Currently, the server will fail with probably a more complexe error message to handle that we can do
FYI @johanste