schema

rovanion 2017-04-27T08:47:18.499029Z

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

rovanion 2017-04-27T08:48:01.506387Z

Perhaps someone else knows a better answer?

rovanion 2017-04-27T08:49:50.525401Z

What is it defschema does? I can't figure out the difference between it and simply using a def.

plins 2017-04-27T14:03:16.985480Z

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")

plins 2017-04-27T14:03:51.995521Z

and i couldnt find something like (schema/Date "dd/mm/yyyy")