Using npm
:
npm i postman-to-openapi-cli -g
Using yarn
:
yarn add postman-to-openapi-cli -g
First install the package globally.
postman-to-openapi -s ./PATH/TO/THE/COLLECTION.JSON -o ./PATH/TO/THE/OUTPUT/OPENAPI.YML
It takes an input relative path of the collection.json file and a relative path of the output folder.
Example:
postman-to-openapi -s ./downloads/input.json -o ./downloads/output.yml