Is the generation of "$ref"s and OpenAPI schemas only supported if you use Malli for coercion? Sorry if that is a poorly worded question. My team has been using spec for coercion, and we are looking into setting up OpenAPI and Swagger UI. However, I am having trouble generating the :schemas map in our OpenAPI document and having our routes reference the items in that map. I see some examples of doing this with Malli, but not using Spec
It's a good question. I should know this since I wrote most of this stuff but I've forgotten 😅 Let me dig out the sources...
Yeah, it looks like only the Malli implementations know how to generate $refs.
I wonder if we have an open issue for this
It seems not
It's been a while since I've used spec in anger. What kind of behaviour are you expecting? A $ref for each s/def?
That might make the openapi spec a bit hard to use since there are a lot of s/defs. In my experience consumers usually want a fairly small number of fairly large map schemas.
Feel free to weigh in on this new issue https://github.com/metosin/reitit/issues/709
<shill> Also, if you really need this feature urgently, consider using our Commercial Open Source Support https://www.metosin.fi/en/open-source-support </shill>
You can also comment on my doc improvement. Would these docs have answered your question? https://github.com/metosin/reitit/pull/711
Thanks for the great clarification! I've added my thoughts to the issues you created. My team is not in a position yet to start funding open source Clojure dev yet, but that is certainly on the agenda given a little more growth. Do you have a tip jar or something like that? Would be happy to at least donate enough for a trip to the cafe for the metosin team.
Tbh this is just another signal to me that we should probably bite the bullet and move over to malli. It does not seem like others are requesting this feature, and so maybe it makes sense for us to just move to where the mindshare is
No, we don't have a tip jar as such, but Clojurists Together funds some of our open source work, and is a great way to pool small donations!