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
The API I am accessing returns JSON with a field that will return null for almost all fields. If I POST/PUT this model back into the API, it will interpret the null values as if they are unset.
There is an exception to this. One specific String field (however, there is no reason why in future this could not apply to other value types) in which a POST/PUT operation must be one of x values.
As a result, I apply the choices options and also a default The field is current defined as: option = fields.String(choices=['FOO', 'BAR', 'ANY', 'NONE'], default='NONE')
Is there a method to remove the undesired behaviour above, in which a null breaks the option field?
I have added None to the list of choices for the field, but then this also makes the default redundant, given that the API returns null everytime it is unset.
The text was updated successfully, but these errors were encountered:
The API I am accessing returns JSON with a field that will return
null
for almost all fields. If I POST/PUT this model back into the API, it will interpret thenull
values as if they are unset.There is an exception to this. One specific
String
field (however, there is no reason why in future this could not apply to other value types) in which a POST/PUT operation must be one of x values.As a result, I apply the
choices
options and also adefault
The field is current defined as:option = fields.String(choices=['FOO', 'BAR', 'ANY', 'NONE'], default='NONE')
Imagine the following though.
Is there a method to remove the undesired behaviour above, in which a
null
breaks theoption
field?I have added
None
to the list of choices for the field, but then this also makes thedefault
redundant, given that the API returnsnull
everytime it is unset.The text was updated successfully, but these errors were encountered: