4 ms·
Ask HN: Node.js API Documentation
What do you use to get a swagger.json or similar for api documentation?
In the dotnet world there is swashbuckle. Is there a node equivalent or better?
- Sheepsteak 5y agoI think the official swagger-node (https://github.com/swagger-api/swagger-node https://github.com/swagger-api/swagger-node) hasn't been updated for a while. There is swagger-jsdoc (https://www.npmjs.com/package/swagger-jsdoc https://www.npmjs.com/package/swagger-jsdoc) though.
- Raed667 5y agoI have been using tsoa to generate API documentation from TypeScript types. https://github.com/lukeautry/tsoa https://github.com/lukeautry/tsoa Example project: https://github.com/RaedsLab/demo-project/blob/master/backend/src/controller/todo.ts https://github.com/RaedsLab/demo-project/blob/master/backend...
- bacbilla 5y agoSecond this, it's a great piece of work.
- vmarchaud 5y agoWe used tsoa where i work but had issues with complex types [0] so one of our dev rewrote a simpler implementation [1] that use ts-morph [2] under the hood. Not exactly related but we had issues with the official openapi generated so he also wrote a package to codegen typescript client from an openapi file [3] [0]: https://github.com/lukeautry/tsoa/pulls?q=is%3Apr+sort%3Aupdated-desc+author%3AEywek+is%3Aclosed https://github.com/lukeautry/tsoa/pulls?q=is%3Apr+sort%3Aupd... [1]: https://github.com/Eywek/typoa https://github.com/Eywek/typoa [2]: https://github.com/dsherret/ts-morph https://github.com/dsherret/ts-morph [3]: https://github.com/Eywek/oatyp https://github.com/Eywek/oatyp