Fork me on GitHub
#malli
<
2021-03-12
>
genRaiy12:03:33

I want to protect the swagger doc built from the malli data model using buddy. I have seen the reitit examples which protect routes but it's not clear how this integrates into the Swagger model ... I will also x post to reitit

genRaiy15:03:20

[ thanks for the answer by @ikitommi in #reitit ]

borkdude21:03:52

Just had a thought. Can malli be used in places where currently meander or matchete (https://github.com/xapix-io/matchete) are used? Although this works, it is a bit cumbersome:

user=> (m/validate [:cat [:enum 1] :any [:enum 3]] '[1 2 3])
true

borkdude21:03:22

And how could I get the destructured value, after validation?

user=> (m/explain [:catn [:a [:enum 1]] [:b :any] [:c [:enum 3]]] '[1 2 3])
nil

borkdude22:03:30

oh of course, parse facepalm

user=> (m/parse [:catn [:a [:enum 1]] [:b :any] [:c [:enum 3]]] '[1 2 3])
{:a 1, :b 2, :c 3}

borkdude22:03:37

Is there a way to indicate that you want to ignore a certain binding in the parsed output?

ikitommi07:03:54

not at the moment. issue welcome.