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

:min :max does not work for predicate function #636

Closed
brjann opened this issue Feb 5, 2022 · 2 comments
Closed

:min :max does not work for predicate function #636

brjann opened this issue Feb 5, 2022 · 2 comments

Comments

@brjann
Copy link

brjann commented Feb 5, 2022

This works

(m/validate [:int {:min 4, :max 9}] 9) ;; :int
;=> true
(m/validate [:int {:min 4, :max 9}] 10) ;; :int
;=> false

But this doesn't

(m/validate [int? {:min 4, :max 9}] 9) ;; int?
;=> true
(m/validate [int? {:min 4, :max 9}] 10) ;; int?
;=> true ;; should be false
@ikitommi
Copy link
Member

ikitommi commented Feb 5, 2022

predicate schemas are just convenience helpers, not real types like :int. See #327 .

@ikitommi ikitommi closed this as completed Feb 5, 2022
@brjann
Copy link
Author

brjann commented Feb 5, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants