Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js Swagger generate UI doc JSON feed

I'm using Node.js and Swagger to build a restful API. The Swagger UI (demo link here http://petstore.swagger.io/) requires a JSON feed.

How would you generate this feed based on the Swagger spec yaml file? Is there not a npm module that can iterate over the yaml file and generate the JSON feed? I'm new to Swagger so I might have overlooked something.

like image 951
ChrisRich Avatar asked Mar 15 '23 07:03

ChrisRich


1 Answers

Swagger UI should support YAML by now. You can convert YAML to JSON using JSYAML library.

like image 161
Mohsen Avatar answered Mar 18 '23 04:03

Mohsen