A common use-case is that there's only a discrete set of possible values for a parameter, but validating this is currently only possible by providing a custom deserializer which can then convert invalid values into some fallback value or similar.
We should evaluate whether a more direct approach for this could be useful, and if so, what it could look like. Some ideas:
Make baking this into a deserializer easier through some factory method.
Provide a restrictTo kind of option which requires & uses the already existing compareWith function
What's your idea?
A common use-case is that there's only a discrete set of possible values for a parameter, but validating this is currently only possible by providing a custom deserializer which can then convert invalid values into some fallback value or similar.
We should evaluate whether a more direct approach for this could be useful, and if so, what it could look like. Some ideas:
restrictTo
kind of option which requires & uses the already existingcompareWith
function