openapi-filter
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -88,2 +88,3 @@ 'use strict'; | ||
while (checkForReferences) { | ||
checkForReferences = false; | ||
let changesMade = false; | ||
@@ -90,0 +91,0 @@ |
@@ -10,7 +10,4 @@ #!/usr/bin/env node | ||
let argv = require('yargs') | ||
.usage('$0 <infile> [outfile]',false,(yargs) => { | ||
yargs | ||
.positional('infile',{ describe: 'the input file' }) | ||
.positional('outfile',{ describe: 'the output file' }) | ||
}) | ||
.usage('$0 <infile> [outfile]') | ||
.demand(1) | ||
.strict() | ||
@@ -83,8 +80,10 @@ .boolean('info') | ||
info('Input file: ' + argv.infile) | ||
const infile = argv._[0]; | ||
const outfile = argv._[1]; | ||
info('Input file: ' + infile) | ||
let s = fs.readFileSync(argv.infile,'utf8'); | ||
let s = fs.readFileSync(infile,'utf8'); | ||
let obj = yaml.parse(s, {maxAliasCount: argv.maxAliasCount}); | ||
let res = openapiFilter.filter(obj,argv); | ||
if (argv.infile.indexOf('.json')>=0) { | ||
if (infile.indexOf('.json')>=0) { | ||
s = JSON.stringify(res,null,2); | ||
@@ -95,6 +94,6 @@ } | ||
} | ||
if (argv.outfile) { | ||
fs.writeFileSync(argv.outfile,s,'utf8'); | ||
if (outfile) { | ||
fs.writeFileSync(outfile,s,'utf8'); | ||
info('Output file: ' + argv.outfile) | ||
info('Output file: ' + outfile) | ||
} | ||
@@ -101,0 +100,0 @@ else { |
{ | ||
"name": "openapi-filter", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "Filter internal paths, operations, parameters, schemas etc from OpenAPI/Swagger definitions", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -44,3 +44,3 @@ # openapi-filter | ||
--servers include complete servers object with --valid [boolean] | ||
--lineWidth, -l max line width of yaml output [number] [default: -1] | ||
--lineWidth, -l max line width of yaml output [number] [default: 0] | ||
--maxAliasCount maximum YAML aliases allowed [number] [default: 100] | ||
@@ -47,0 +47,0 @@ --configFile The file & path for the filter options [path] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148161