schema

2016-08-02T14:39:37.000005Z

Hi. I’m trying to figure out how to substitute both with conditional as suggested by the docs of both.

2016-08-02T14:39:59.000006Z

Say I have a schema like

(s/both {:a s/Int 
               s/Any s/Any} 
              {:b s/Int 
               s/Any s/Any})

2016-08-02T14:41:43.000011Z

I tried to use instead

(s/conditional 
                (constantly true) {:a s/Int s/Any s/Any}
                (constantly true) {:b s/Int s/Any s/Any})

2016-08-02T14:42:15.000012Z

However that will not check the 2nd condition. I.e.

(s/validate (s/conditional 
                (constantly true) {:a s/Int s/Any s/Any}
                (constantly true) {:b s/Int s/Any s/Any})
              {:a 2})

2016-08-02T14:42:31.000013Z

returns valid