2 ms·
Here's my understanding... In Schema, you would represent a map's spec like this: (def my-map {:a s/Str :b s/Int}) In spec, you'd do it like this: (
by gw 10y ago
Here's my understanding...
In Schema, you would represent a map's spec like this:
(def my-map {:a s/Str :b s/Int})
In spec, you'd do it like this:
(s/def ::a string?)
(s/def ::b integer?)
(s/def ::my-map (s/keys :req [::a ::b]))
In other words, the values are specified separately from the keys. This promotes reuse of specs, which is important especially as they get more complex.