You could always write a predicate like:
(schema/defschema string-vector
[schema/Str])
(defn str-vec? [arg]
(try (schema/validate string-vector arg)
true
(catch clojure.lang.ExceptionInfo e
false)))
(str-vec? ["hi"]) ; => true
(str-vec? ["hi" 5]) ; => false
Perhaps someone else knows a better answer?
What is it defschema
does? I can't figure out the difference between it and simply using a def.
right now im trying to create a validator for non-iso string dates to use in compojure-api (the custom date format is "dd/mm/yyyy")
and i couldnt find something like (schema/Date "dd/mm/yyyy")