What does HackerNews think of tsoa?

Build OpenAPI-compliant REST APIs using TypeScript and Node

Language: TypeScript

#93 in Hacktoberfest
This is the best project I’ve found to that for that - https://github.com/lukeautry/tsoa. Uses decorators mainly.

If there are other such projects, please share.

I honestly recommend TSOA (https://github.com/lukeautry/tsoa)

For me it provides enough structure without being a super opinionated framework. It handles route and doc generation based off your models and controllers, but everything else is up to you, which is perfect for me.

I have been using tsoa to generate API documentation from TypeScript types. https://github.com/lukeautry/tsoa

Example project: https://github.com/RaedsLab/demo-project/blob/master/backend...

We use TSOA[1] for that, it can build OpenApi specification from your ts interface. So its could be used for documentation and tsoa can validate but other tools can validate too

[1] https://github.com/lukeautry/tsoa

This is also exactly how I build Express APIs. One thing I'd add: when building an API, use Swagger (or something similar, but Swagger/OpenAPI have basically won, just do it). It makes API clients way, way easier to wrangle and removes a lot of the surprise from your application development. I sometimes forget that not everyone using React or Vue uses Swagger-based APIs that really do just kinda work, but they're a large part of why, for me, writing a fully-featured frontend is way better than entering Rails template hell or whatever. It's really, really easy: just a bit of state in the React component, kick off a fetch during componentWillMount, and drop a spinner that remains 'til you get an error or your data. If you're using TypeScript (and you should be), you'll have some pretty happy autocomplete based on the contents of your state and can just write code off the returned objects. Life's fun this way.

On the server side I use Express in Node and either `tsoa` or `inversify-express-utils`, while in Ruby I use my own Modern[0] library to autogenerate a Swagger document from the controllers I specify.

[0] - https://github.com/lukeautry/tsoa

[1] - https://github.com/inversify/inversify-express-utils

[2] - https://github.com/modern-project/modern-ruby