Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openapi-format

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-format - npm Package Compare versions

Comparing version 1.22.1 to 1.22.2

5

CHANGELOG.md
## 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 @@

5

openapi-format.js

@@ -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'))

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc