malli

https://github.com/metosin/malli :malli:
ikitommi 2021-04-08T07:49:14.352100Z

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

2021-04-08T12:56:47.354500Z

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
ikitommi 2021-04-08T13:37:17.354700Z

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.

ikitommi 2021-04-08T13:37:37.354900Z

would you be interested in a PR?

Setzer22 2021-04-08T16:56:22.355500Z

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
borkdude 2021-04-08T17:29:27.356500Z

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?

Setzer22 2021-04-08T17:38:23.358500Z

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

ikitommi 2021-04-08T17:41:02.360100Z

@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
2021-04-14T12:20:57.441500Z

I've made some questions asking about Intrument impl

2021-04-14T12:21:09.441700Z

what malli expects for it

ikitommi 2021-04-14T13:11:49.441900Z

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

1
ikitommi 2021-04-08T17:41:49.360300Z

Also related: https://github.com/metosin/malli/issues/369

ikitommi 2021-04-08T17:45:47.360700Z

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

Setzer22 2021-04-08T19:30:15.361400Z

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

Setzer22 2021-04-08T19:35:05.362600Z

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