Allow enum with blank value as valid output by schema#648
Allow enum with blank value as valid output by schema#648pulges wants to merge 1 commit intojosdejong:developfrom
Conversation
|
Thanks for your PR @pulges . Just thinking: shouldn't we simply remove the current behavior which always adds a blank value (and makes an empty string in that case)? So |
|
I thought about that, but the logic would lack then an option to display invalid/null value already present in json. From UX perspective it might work, if invalid option would be still rendered with '--', but with the validation not passing. If user picks another value '--' disappears from options. Thus user can not pick back invalid value. |
|
That's a good point. Maybe when the current value is invalid, we could let the enum add an extra entry for this with a clear indication that this current value is invalid. Suppose the current value is "foo" and is invalid, the dropdown could render "foo (INVALID)" as first entry, and as you suggest, remove this entry as soon as the user picks a valid value. |
Adds an option to configure blank value for enum lists in shema.
Adds support for enum lists containing the blank value. (Currently double blank options where rendered in list)