Rest API post for optional enum field with empty value gives validation error

When i try to post through a REST api to a collection that has an optional enum type field it doesn’t let me post with an empty value. But if I post with a selected value it works fine.

this is the validation error
[field] must be one of the following values: [list of possible values]
err: ValidationError

Is it something i’ve done wrong or it’s the default behaviour of strapi?
Does anyone know a possible fix?

Using version 4.9.2, node 18.15.0.

Make sure your advance settings look like this for the field and if you haven’t selected any option then don’t submit that field name to your Post REST api.

1 Like

Thank you very much, my settings do look like that but i haven’t tried not submitting the field. Will try that.

Only got back to that project now, but this worked for me.
Thank you very much.

1 Like