malli

https://github.com/metosin/malli :malli:
Daniel Miladinov 2021-02-18T19:56:54.105900Z

Is it possible to use a `[:map …]` spec to describe interactions / interdependencies with map keys / values? Like, “either this key or that key must be set”, or “these two keys must either both have empty values or both be set”

borkdude 2021-02-18T19:58:40.106200Z

This is probably done using a predicate on the map?

3
borkdude 2021-02-18T19:58:59.106600Z

(Guess)

Daniel Miladinov 2021-02-18T19:59:49.107400Z

I mean, I know I can write a [:fn …] spec and do whatever I need with the map validation, but I was wondering if there was anything more declarative.

ikitommi 2021-02-18T20:49:26.113400Z

@daniel.miladinov if you can cook up a good declarative syntax for defining the rules, I can try to summon a custom schema to do that. Declarative rule systems are not always simple.

ikitommi 2021-02-18T20:50:34.115400Z

Not sure if something like meander could be used to declare rules like that. Bridging Malli and Meander might be fun