Fork me on GitHub
#malli
<
2021-02-18
>
Daniel Miladinov19:02:54

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”

borkdude19:02:40

This is probably done using a predicate on the map?

10
Daniel Miladinov19:02:49

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.

ikitommi20:02:26

@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.

ikitommi20:02:34

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