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 was thinking it would be nice to have an option like this
[:map
[:party/type {:optional false} [:or [:= "company-type"] [:= "person-type"]]]
[:party/company-name {:optional false :error/message "company name is required for party type 'company-type'" } :string]
[:party/person-name {:optional true} :string]]
rather than having to pass the error message for missing key like this
(me/humanize (m/explain schema party)
{:errors (-> me/default-errors
(assoc ::m/missing-key {:error/fn (fn [{:keys [in]} e]
(str "company name is required " (last in)))}))})```
having both :error/message or :error/fn where the function passes me the error would be ideal since the schema now contains all it needs to output good error messages
having to use the me/default errors seems clunky to me and requires extra step to keep those messing key maps around when I could put them right on the schema
If you approve of this I am willing to try and implement it
The text was updated successfully, but these errors were encountered:
Let's say I have a schema like this for a party
I was thinking it would be nice to have an option like this
rather than having to pass the error message for missing key like this
The text was updated successfully, but these errors were encountered: