26 ms·
I've implemented Swagger with several APIs and agree that it's crazy complex and time-consuming to write Swagger files manually. I believe the best use-case fo
by metachris 10y ago
I've implemented Swagger with several APIs and agree that it's crazy complex and time-consuming to write Swagger files manually.
I believe the best use-case for Swagger is to develop the API (perhaps just defining the routes with payload and response, but without controllers), and then auto-generating the Swagger files. This way the API consumers always have an up-to-date documentation, and there is only one place which represents the current state of the API.
- dvirsky 10y agoExactly. I wrote a project (https://github.com/EverythingMe/vertex https://github.com/EverythingMe/vertex) where you define the API with a semi declarative syntax in Go, and it just translates to swagger so you can generate documentation and playgrounds effortlessly. It worked very well.
- blazespin 10y agoSwagger yaml is hard to write? Hmm.. relative to the code that services it or consumes it, I find its pretty trivial.