Fork me on GitHub
#clojure-spec
<
2020-02-05
>
colinkahn06:02:09

@kenny couldn't you do this with a multi-spec defmethods returning select specs?

kenny15:02:51

Not when it's a nested collection.

colinkahn16:02:42

Ah right, agreed this would be great to have built in

kenny16:02:04

Definitely agree. Fortunately it's not that hard to build in yourself if it doesn't include it. It really does seem like something it should support by default though.

colinkahn17:02:50

Right, I built a spec that did something like this for spec-1, basically “clamped” nested multi-specs. It was a bit unwieldy because the definitions had to be so long.

Wilson Velez14:02:05

hi, when to use :req or :req-un? I’ve used :req-un always

orestis15:02:32

If you have maps with namespaced keywords, use :req