Fork me on GitHub
#reitit
<
2023-08-31
>
Bingen Galartza Iparragirre10:08:47

Hello! Is it possible to generate multiple swagger definitions with the Reitit builtin swagger support? Instead of having all the endpoints in a single Swagger document/page we would like to have multiple. The goal is to have different subsets of endpoints depending on who is the documentation intended for (private API, public API, etc...). Thx

yes 2
hanDerPeder07:09:33

Rolling your own is fairly straight forward. I would copy the reitit.swagger ns code to a ns you own, figure out how it works, then parameterize the handler on path or whatever.

Bingen Galartza Iparragirre09:09:36

Ok, great! We will explore that path. Thank you

Bingen Galartza Iparragirre15:09:10

I missed this [1] while reading the docs 😅. What I wanted to achieve is already supported by Reitit: [1] https://github.com/metosin/reitit/blob/master/doc/ring/swagger.md#multiple-swagger-apis