This feature would allow you to be able to opt-out of key validation entirely, rather than having to decide between required and optional, because, for example, we’ve validated earlier that keys are present if they need to be.
It would work like this:
key(:something).filled(:string)
and whether or not the key was present, we would get back a filled? error if the value isn’t present (because either the key is missing or the key is there but no value is).
This feature would allow you to be able to opt-out of key validation entirely, rather than having to decide between
required
andoptional
, because, for example, we’ve validated earlier that keys are present if they need to be.It would work like this:
and whether or not the key was present, we would get back a
filled?
error if the value isn’t present (because either the key is missing or the key is there but no value is).Originally discussed on Discourse