Fork me on GitHub
#malli
<
2021-04-08
>
ikitommi07:04:14

@roseneck if the strip-extra-keys-transformer is not enough (just map keys), please provide an example with schema, input and expected output.

jeremie12:04:47

Hi all, just wonder if there is a malli schema for validating reitit route? like the reitit.spec namespace in reitit.core but for malli. My use case is describing API endpoints and referencing the reitit route for each endpoint would be great. Thanks.

👍 1
ikitommi13:04:17

not yet. One of the initial reasons for creating malli was to have a tool where one can deep-merge nested schemas without tears, to be used in reitir route data validation.

ikitommi13:04:37

would you be interested in a PR?

Setzer2216:04:22

Hi there! Missing spec's validation now that I've migrated to malli, I rolled my own thing: https://github.com/setzer22/malli-instrument Let me know what you think! 😄

👍 1
borkdude17:04:27

I wonder, didn't malli already have something to instrument functions with malli schemas? if not so, how were the function specs intended to be used?

Setzer2217:04:23

If there is, I couldn't find it anywhere 🤷 What's there, besides function schema syntax, is a global function registry and a macro, m/=> to add functions to that registry. I just built a super simple thing on top of all this

ikitommi17:04:02

@setzer22 looks good. Plan is to have the instrumentation in malli core lib, but just not there yet, see: https://github.com/metosin/malli/issues/349

👍 1
Ian Fernandez12:04:57

I've made some questions asking about Intrument impl

Ian Fernandez12:04:09

what malli expects for it

ikitommi13:04:49

noticed, thanks! need to think it over before answering.

clojure-spin 2
ikitommi17:04:47

... but the idea seems exactly what you have already implemented. Maybe the lib could be just a new ns under malli?

Setzer2219:04:15

@ikitommi Oh, I'd be glad to contribute if you think it fits! 👍

Setzer2219:04:05

let me know if you'd like me to submit a PR with this