Investigate 311
Closed this issue · 3 comments
We absolutely need swagger docs. There's no better way to properly coordinate frontend and backend.
Seems there's already a well supported project that'll do it for us. We should investigate it further.
On the client side, we should probably consider this
https://github.com/swagger-api/swagger-js
This does dynamic client stub generation it seems though, which is non-ideal if we're going for the full performance idea.
Alternatively, there's this:
https://github.com/swagger-api/swagger-codegen
But it seems like that'll only do typescript stub generation and I have no idea if that'll even work at all with svelte.
Alternatively, we should maybe consider this?
https://github.com/go-swagger/go-swagger
Instead of writing the api then generating the swagger doc, it works schema first. This has the advantage of reducing go's annoying boilerplate, as we just need to edit the swagger doc to add apis. My concern is how well it would deal with merging but I guess we should just try and see.
I'm actually inclined to use this one, as I don't like the idea of adding extensive comments throughout our code for swaggo, and I'm not really keen on all the boilerplate involved in echo either.
PS. It seems to be quite a bit more popular on reddit too, and it's got more stars, commits, contributors, etc. At a glance it's much better supported.
Going with go-swagger for backend codegen and swagger-codegen for the frontend codegen.