malli

https://github.com/metosin/malli :malli:
mike_ananev 2020-07-26T11:01:51.224Z

Hi! How I can express if A is optional in schema and if A exists then B should present too?

borkdude 2020-07-26T11:02:56.224200Z

probably using a predicate?

mike_ananev 2020-07-26T11:08:37.224600Z

I mean how to express it as spec (inside spec one value depends on another) ?

mike_ananev 2020-07-26T11:12:14.225700Z

{
 :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?

ikitommi 2020-07-26T11:57:37.227200Z

@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"]}`

mike_ananev 2020-07-26T12:01:14.227600Z

@ikitommi Thanks! 👍