schema

rb1719 2017-02-13T14:35:59.000036Z

In schema is there an or function. Say I wanted a positive integer and zero. For just a positive number I can do (s/defschema y (s/constrained s/Int pos?)) . If I then do (s/validate y 2) it works. But (s/validate y 0) fails. How can I extend my function y to 0 as well

metametadata 2017-02-13T15:52:01.000037Z

@rb1719 how about (s/defschema y (s/constrained s/Int #(>= % 0)) ?