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

:not humanizer #1138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

frenchy64
Copy link
Collaborator

@frenchy64 frenchy64 commented Nov 26, 2024

This seems like a cheap and easy trick to automatically get a :not humanizer for most (simple) schemas.

Before supporting negated composite schemas we need to enhance humanizing to distinguish between conjunctions and disjunctions. Then we can leverage this for explaining negations:

;; should be [:and "should be a string" "should be a symbol"]
(me/humanize (m/explain [:and :string :symbol] nil))
;=> ["should be a string" "should be a symbol"]

;; should be [:or "should be a string" "should be a symbol"]
(me/humanize (m/explain [:or :string :symbol] nil))
;=> ["should be a string" "should be a symbol"]

@frenchy64 frenchy64 marked this pull request as ready for review November 26, 2024 22:18
@frenchy64 frenchy64 marked this pull request as draft November 27, 2024 00:04
@frenchy64 frenchy64 marked this pull request as ready for review November 27, 2024 00:58
@frenchy64 frenchy64 self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant