Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by
edited by

The wiki explains that we could include a map of unqualified keys to specs

Additionally, you may include a map of unqualified keys to the specs or spec names that should be used for them:
[::a ::b {:c (s/spec int?)}]

But generators created for such specs fail trying to resolve the spec

(require '[clojure.alpha.spec :as s]) (require '[clojure.alpha.spec.gen :as gen]) (s/def ::a string?) (s/def ::b string?) (gen/generate (s/gen (s/schema [::a ::b {:c (s/spec int?)}])))

returns the following error
> Execution error (IllegalArgumentException) at clojure.alpha.spec.protocols/eval1957$fn$G (protocols.clj:11).
No implementation of method: :gen* of protocol: #'clojure.alpha.spec.protocols/Spec found for class: clojure.lang.PersistentList

1 Answer

0 votes
by
...