Closed blindcoding9 closed 10 months ago
This trick works:
(let [schema [:or
[:map {:closed true}
[:A :string]]
[:map {:closed true}
[:B :string]]]]
[(m/validate schema {})
(m/validate schema {:A "S"})
(m/validate schema {:B "B"})
(m/validate schema {:A "S" :B "B"})])
=> [false true true false]
duplicate of #474
How can I validate that the map has one key or another?
Both: