Fork me on GitHub
#clojure-spec
<
2018-10-11
>
domkm16:10:24

Has anyone written a generator for keys that always chooses to generate optional entries until *recursion-limit* is reached?

domkm18:10:06

It seems like this may not be possible currently because whenever a generator-creating function is allowed (`with-gen`, (keys :gen (fn [] ...))) it is takes 0 args while the default generator-creating functions take 3 args (`[overrides path rmap]`). Why do custom generators not have access to the current length of recursion?

basti21:10:22

I’ve got a pretty specific question regarding clojure spec-tools’s dataspecs - i’ve got those two data specs, how do I “or” them together?

{:status (s/spec #{200})
   :success boolean?
   :body {:data [{:id string?}]}}
{:status (s/spec #{500})
   :success boolean?
   :body empty?}