Search code examples
node.jsnpmswaggerdocumentationopenapi

Generating JSDoc from OpenAPI Spec


I have an OpenAPI spec from an API service I use (in the form of a swagger.json file). I would like to expedite the dev process for generating my endpoints and it would be nice to have them documented with JSDoc to keep things running smoothly in VS Code.

I have found several JSDoc-to-Swagger/OpenAPI parsers and OpenAPI renderers, e.g.:

However, these packages take JSDoc as the input, and render the Swagger / OpenAPI spec as the output. I'm looking to do the reverse. Google has not been helpful and I haven't seen much on StackOverflow either.

Does anyone have any recommendations short of implementing my own package for this?


Solution

  • This package will generate code for you from your swagger, not exactly what you are after, but might be worth looking into.