You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it's intentional, because it's being tested to fail on false in doc test. But I can't see reason behind this. You simply can define your own validator for this case:
defmoduleMyValidators.StrictPresencedouseVex.Validator@message_fields[value: "The bad value"]defvalidate(false,_options),do: :okdefvalidate(value,options),do: Vex.Validators.Presence.validate(value,options)endconfig:vex,sources: [[strict_presence: MyValidators.StrictPresence],Vex.Validators]Vex.validate(%{"a"=>false},[{"a",[strict_presence: true]}])
Evaluating:
returns:
If this is normal how can I validate that the key
a
exists in the map regardless of its value?The text was updated successfully, but these errors were encountered: