Allow preventing "Enum from integer" coercion using new CoercionConfig
system
#2903
Labels
coercion-config
Issue related to 2.12 added "CoercionConfig"
Milestone
(follow-up for #2750 )
One coercion that has been problematic (and configuration setting was been requested for) is that of accepting integer value, assumed to be used as the index of
Enum
. While this can be efficient representation it can be brittle (as index can change if Enums are reordered in class definition) and cause invalid content to be accepted.Configuration should probably be of form:
Note, too, that this should allow alternatives of
AsEmpty
(default value, if specified, otherwise...null
?) andAsNull
.The text was updated successfully, but these errors were encountered: