This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-26
Channels
- # announcements (6)
- # beginners (69)
- # calva (10)
- # clj-kondo (9)
- # clojure (32)
- # clojure-uk (9)
- # clojuredesign-podcast (13)
- # clojurescript (14)
- # clojureverse-ops (2)
- # conjure (24)
- # cursive (12)
- # data-science (1)
- # datomic (13)
- # graalvm (5)
- # jobs-discuss (4)
- # malli (6)
- # meander (33)
- # off-topic (9)
- # pedestal (2)
- # re-frame (38)
- # reitit (6)
- # rum (4)
- # shadow-cljs (6)
- # tools-deps (8)
- # xtdb (26)
Hi! How I can express if A is optional in schema and if A exists then B should present too?
I mean how to express it as spec (inside spec one value depends on another) ?
{
:java-src-folder "test-projects/javac/src/java"
:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"] }
How to express as spec if :java-src-folder is present then :javac-options should be present?@mike1452 you can compose rules with :and
, from README:
`(-> [:and [:map
[:password string?]
[:password2 string?]]
[:fn {:error/message "passwords don't match"
:error/path [:password2]}
'(fn [{:keys [password password2]}]
(= password password2))]]
(m/explain {:password "secret"
:password2 "faarao"})
(me/humanize))
; {:password2 ["passwords don't match"]}`
@ikitommi Thanks! 👍