diff --git a/examples/PingTest_V1.no-batch.openapi3.json b/examples/PingTest_V1.no-batch.openapi3.json index d6c10ab9..fa65cbeb 100644 --- a/examples/PingTest_V1.no-batch.openapi3.json +++ b/examples/PingTest_V1.no-batch.openapi3.json @@ -255,4 +255,4 @@ } } } -} +} \ No newline at end of file diff --git a/lib/cli.js b/lib/cli.js index 23267b77..a4deb87d 100755 --- a/lib/cli.js +++ b/lib/cli.js @@ -101,7 +101,7 @@ function convert(source) { skipBatchPath: argv.skipBatchPath, defaultTitle: argv.title, defaultDescription: argv.description, - rootResourcesToKeep: Array.isArray(argv.keep) ? argv.keep : [argv.keep], + rootResourcesToKeep: Array.isArray(argv.keep) ? argv.keep : argv.keep? [argv.keep]: undefined, }); stringifyStream(openapi, null, argv.pretty ? 4 : 0).pipe( diff --git a/package.json b/package.json index 8878ea55..746012f7 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ }, "scripts": { "build": "node lib/transform.js", + "pretest": "node lib/cli.js -p --skipBatchPath -t examples/PingTest_V1.no-batch.openapi3.json examples/PingTest_V1.xml", "test": "c8 mocha", "watch": "mocha --watch" },