1

I've been following the ring-swagger server.clj example to set my own http server but with prismatic/schema coercion.

Everything works just fine when my leafs are of basic type such as s/Str or s/Int, but I can't get it to work with (s/pred pos-int?) for example.

Every time I try to get the server's swagger API page, an error is thrown:

don't know how to convert clojure.core$pos_int_QMARK_@1870c292 into a Swagger Schema

I understand I should be using the :ignore-missing-mapping? true setting from the ring-swagger documentation but I have no idea where do I pass that.

I'm using reitit v0.5.12, and I see that inside reitit-schema, the settings I pass from my router definition are not passed to the schema-tools ns functions when I pass the :coercion reitit.coercion.schema/coercion coercion: https://github.com/metosin/reitit/blob/master/modules/reitit-schema/src/reitit/coercion/schema.cljc#L52

I'm not sure how can I setup a prismatic-schema to work with swagger, besides constricting myself to only use plain schemas leafs such as s/Int, s/Str, etc.

4

0 回答 0