Fork me on GitHub
#malli
<
2020-11-24
>
helios15:11:06

It's not clear how i could say that i want a non-empty map in my schema, that also works with generators 🙂

helios15:11:59

(mg/generate [:and
              [:fn not-empty]
              [:map-of
               [:string {:gen/gen gen/string-ascii}]
               [:string {:gen/gen gen/string-ascii}]]])
this ofc works for validation but not with generators

ikitommi15:11:33

@U0AD3JSHL try reversing that, :map-of as first child. :and generates based on first, and narrows with the rest.

✔️ 3
helios15:11:20

uh, nice one 🙂

Hankstenberg21:11:05

malli is absolutely awesome, thanks a lot guys! đź‘Ť

🙇 3
ordnungswidrig21:11:42

Is there a “canonical representation” for malli? I guess it’s the “vector” syntax as opposed to the “map” syntax, right?