I'm using swager-jsdoc to document all the DTOs of the app.
I was wondering is there any way to generate the swagger docs automatically from typescript interfaces.
I have a lot of them in the project and also a lot of mongoose schemas and models. It is getting tedious to keep them in sync. On the other hand I do not want to use the swagger generation tools. I prefer the bottom-up approach.
Cheers
Yes, you can easily generate Swagger and OpenAPI documents from your TypeScript types by using tsoa. The readme contains all of the setup information that you would need to start using it. It's compatible with express, hapi, koa, and more:
https://github.com/lukeautry/tsoa
(Full Transparency: I am one of the maintainers of tsoa. But I was first a consumer of tsoa and I find it to be a great product... that's why I asked to help maintain it! :) )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With