This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-26
Channels
- # announcements (3)
- # architecture (53)
- # babashka (6)
- # beginners (101)
- # bitcoin (3)
- # calva (4)
- # cider (3)
- # clara (7)
- # cljdoc (2)
- # cljsrn (14)
- # clojure (104)
- # clojure-europe (96)
- # clojure-germany (21)
- # clojure-nl (6)
- # clojure-serbia (3)
- # clojure-spain (1)
- # clojure-uk (13)
- # clojuredesign-podcast (4)
- # clojurescript (14)
- # cursive (5)
- # data-science (19)
- # datomic (16)
- # emacs (15)
- # fulcro (33)
- # graalvm (5)
- # honeysql (3)
- # instaparse (2)
- # jobs (3)
- # lsp (82)
- # malli (2)
- # off-topic (11)
- # pedestal (4)
- # polylith (62)
- # practicalli (4)
- # shadow-cljs (56)
- # tools-deps (53)
- # vim (17)
- # xtdb (53)
mawning
morning
How would I use spec
to specify an optional positional arg, but define the contents of that arg if it exists? Like, my current spec is:
(s/fdef set-http-probe :args (s/cat :deployment ::kube-deployment/deployment
:kind #{:startup :liveness :readiness :default}
:args (s/keys :opt-un [::kube/probe-kind ::kube/http-port ::kube/path ::kube/probe-args])))
but I actually want to not have to specify the args
parameter at all. At the moment if there are no additional optional args to provide I have to call the function with an empty map at that location. I tried wrapping s/keys
in s/nilable
, but in that case I still had to provide an explicit nil
final arg in my callDoing 2x s/cat
(1 missing :args
entirely) that are combined with a basic or
doesn't seem to quite work either