Fork me on GitHub
#malli
<
2020-04-15
>
orestis13:04:05

I saw the ClojureD talk where it’s mention that there was some experiments tying malli and clj-kondo together. Is that code somewhere available? I’d love to have compile-time checks of some map usage. I don’t care particularly about the syntax right now, mostly about the hooking up kondo and its analyzer to validate malli schemas.

ikitommi16:04:57

@orestis it was a quick hack, not published to repo. The m/defn is 1:1 from plumatic schema, emitting a clj-kondo file into the project. No generic conversion and plumatic port just a poc. Would take a day to make it real.

orestis16:04:31

So essentially it was just emitting clj-kondo specific schemas for the function, right? As if you hand-typed the kondo conf manually. I can work with that...

ikitommi16:04:08

yes. Generic malli Schema -> clj-kondo schema transformer would be great - and relatively easy to do, just like the json-schema transformer.

ikitommi16:04:12

@jstuartmilne if you know the form of the swagger schema, you could add the swagger transformation for :multi. It's an multimethod doing that, so can be done in user space. PR welcome when it works ;)

ikitommi16:04:05

Also, you can write the swagger manually, just add a :swagger key to schema and a full schema as value. Overrides everything

sudakatux22:04:42

cool thanks. it working how i want now 🙂