openapi-format
Advanced tools
Comparing version 1.22.1 to 1.22.2
## unreleased | ||
## [1.22.2] - 2024-08-16 | ||
- Filter - Only remove path methods, keeping similarly named properties | ||
- Filter - Prevent removal of empty objects in oneOf, allOf items | ||
## [1.22.1] - 2024-08-04 | ||
@@ -4,0 +9,0 @@ |
@@ -294,3 +294,4 @@ #!/usr/bin/env node | ||
// Filter out object matching the "methods" | ||
if (filterKeys.length > 0 && filterKeys.includes(this.key)) { | ||
if (filterKeys.length > 0 && filterKeys.includes(this.key) | ||
&& this.parent && this.parent.parent && this.parent.parent.key === 'paths') { | ||
// debugFilterStep = 'Filter - methods' | ||
@@ -593,3 +594,3 @@ this.remove(); | ||
(typeof filterSet.preserveEmptyObjects === 'undefined') && | ||
(!['security', 'schemas', 'default'].includes(this.parent.key) | ||
(!['security', 'schemas', 'default', 'oneOf', 'allOf'].includes(this.parent.key) | ||
&& ((this.key === "examples" || this.key === "example") | ||
@@ -596,0 +597,0 @@ || !this.path.includes('example') && !this.path.includes('examples')) |
{ | ||
"name": "openapi-format", | ||
"version": "1.22.1", | ||
"version": "1.22.2", | ||
"description": "Format an OpenAPI document by ordering, formatting and filtering fields.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -153,3 +153,2 @@ // utils-file.js | ||
output = await stringify(data, options); | ||
} else { | ||
@@ -163,7 +162,5 @@ // Convert Object to JSON string | ||
fs.writeFileSync(filePath, output, 'utf8'); | ||
// console.log(`- Output file:\t\t${outputFilePath}`); | ||
} catch (err) { | ||
console.log('err', err) | ||
console.error('\x1b[31m', `Error writing file "${filePath}": ${err.message}`); | ||
throw err | ||
// throw new Error(`Error writing file "${filePath}": ${err.message}`); | ||
} | ||
@@ -170,0 +167,0 @@ } |
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
147649
2145