Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
version: packageInfo.version
});
parser.addArgument(['-i', '--input'], {
required: true,
help: 'Path to the swagger yaml file',
metavar: '',
dest: 'input'
});
parser.addArgument(['-o', '--output'], {
help: 'Path to the resulting md file',
metavar: '',
dest: 'output'
});
parser.addArgument(['--skip-info'], {
action: Action.storeTrue,
nargs: 0,
help: 'Skip the title, description, version etc, whatever is in the info block.',
metavar: '',
dest: 'skipInfo'
});
const args = parser.parseArgs();
if (args.input) {
const document = [];
try {
const inputDoc = yaml.safeLoad(fs.readFileSync(args.input, 'utf8'));
const outputFile = args.output || args.input.replace(/(yaml|yml|json)$/i, 'md');
// Collect parameters
const parameters = ('parameters' in inputDoc) ? inputDoc.parameters : {};