this is super useful, thanks for the post! I have a use case where I want to generate some crud operations as well for some map specs - do you have any pointers for functions you used to parse the specs? I see s/describe
and s/form
did you use those or something else?
Just those. To get at the primary list of required/optional keys.
perfect, thanks!
How do you define a map spec with keys of similar spec? e.g.:
(s/def potato-name string?)
(s/def potato-happiness number?)
;; This is a potato:
{:name "potato name"
:happiness-1 12
:happiness-2 54}
Similarly, I see that (s/keys) requires a fully qualified name for each key and it's strange to me. What if I got two specs with the same key but different specs?the idea behind spec is to give attributes global semantic meaning, by using namespaced attributes to differentiate and not do that