This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-07
Channels
- # aleph (4)
- # arachne (2)
- # aws (2)
- # beginners (42)
- # boot (4)
- # cider (47)
- # cljs-dev (352)
- # clojure (278)
- # clojure-dusseldorf (6)
- # clojure-italy (6)
- # clojure-russia (1)
- # clojure-spec (15)
- # clojure-uk (94)
- # clojurescript (197)
- # community-development (34)
- # cursive (3)
- # data-science (1)
- # datomic (64)
- # emacs (3)
- # figwheel (16)
- # fulcro (7)
- # hoplon (5)
- # jobs (3)
- # luminus (3)
- # mount (2)
- # nyc (1)
- # off-topic (31)
- # onyx (22)
- # parinfer (1)
- # protorepl (7)
- # re-frame (9)
- # reagent (61)
- # ring-swagger (3)
- # shadow-cljs (149)
- # spacemacs (18)
- # specter (4)
- # timbre (1)
- # unrepl (38)
- # vim (17)
- # yada (14)
that was my guess
is there any function like (complete ::somespec {::provided-value 2})
that will generate keys that aren't provided?
I could provide overrides like {::provided-value #(gen/return 2)}
I have written such a function, just interested to know if it exists somewhere in spec
and there’s another lib called Orchestra that gives you a version of instrument
that checks :args
and :ret
(and maybe :fn
?)
Is this a bug?
user=> (s/def ::a integer?)
:user/a
user=> (s/explain (s/merge (s/keys :req [::a]) (s/keys :req [::b])) {::a "a" ::b 1})
In: [:user/a] val: "a" fails spec: :user/a at: [:user/a] predicate: integer?
In: [:user/a] val: "a" fails spec: :user/a at: [:user/a] predicate: integer?
nil
I would expect only one message to get spit out, not two. But since s/merge
calls each of its sub-maps' validators, it gets the error message twice.
@aengelberg each s/keys
validates keys for presence, and every key of a known spec (even not mentioned ones) for conformance