oliyh / martian

The HTTP abstraction library for Clojure/script, supporting OpenAPI, Swagger, Schema, re-frame and more
MIT License
539 stars 44 forks source link

Make schema backend pluggable too #124

Open spieden opened 2 years ago

spieden commented 2 years ago

Hello,

What about making the schema backend pluggable just like the HTTP client one? Would be nice to support Clojure spec and malli, for example:

https://github.com/metosin/malli

oliyh commented 2 years ago

Hello,

I did actually start a branch to support clojure.spec, which is here: https://github.com/oliyh/martian/tree/clojure-spec

I got most of the way there, but it was quite complicated. I was going more down the path of supporting both spec and schema at the same time, rather than making them pluggable, but pluggable is probably a better way to go.

The hardest part was turning a swagger document into the schema, but I expect Malli to have much better support for that than clojure.spec so it might be easier.

PRs welcome, as always :)