Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy way to attach custom errors to schemas #254

Closed
ikitommi opened this issue Sep 10, 2020 · 2 comments · Fixed by #255
Closed

Easy way to attach custom errors to schemas #254

ikitommi opened this issue Sep 10, 2020 · 2 comments · Fixed by #255
Labels
Clojurists Together Sponsored by Clojurists Together Q3 2020

Comments

@ikitommi
Copy link
Member

Maybe lift the ErrorSchema protocol from malli.error to malli.core to enable setting the custom errors like this:

(m/-simple-schema {:type :symbol, :pred symbol?, :error/message {:en "should be symbol"}}})
@ikitommi ikitommi added the Clojurists Together Sponsored by Clojurists Together Q3 2020 label Sep 10, 2020
@ikitommi
Copy link
Member Author

This will be fixed in #255 .

@ikitommi
Copy link
Member Author

(-> (m/-simple-schema
      {:type :symbol
       :pred symbol?
       :type-properties {:error/message {:en "should be symbol"}}})
    (m/explain "invalid")
    (me/humanize))
; => ["should be symbol"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clojurists Together Sponsored by Clojurists Together Q3 2020
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant