Open mkreis opened 7 months ago
Open this feature request as discussed here: https://clojurians.slack.com/archives/CLDK6MFMK/p1701249325700779
It would be great if it was possible to programmatically define :error/path depending on the validation function (and the data to be validated).
:error/path
In below example from the docs :error/path only accept vectors is hard-coded to [:password2]:
[:password2]
(-> [:and [:map [:password string?] [:password2 string?]] [:fn {:error/message "passwords don't match" :error/path [:password2]} (fn [{:keys [password password2]}] (= password password2))]] (m/explain {:password "secret" :password2 "faarao"}) (me/humanize)) ; {:password2 ["passwords don't match"]}
Open this feature request as discussed here: https://clojurians.slack.com/archives/CLDK6MFMK/p1701249325700779
It would be great if it was possible to programmatically define
:error/path
depending on the validation function (and the data to be validated).In below example from the docs
:error/path
only accept vectors is hard-coded to[:password2]
: