openapi-format
Advanced tools
Comparing version 1.22.2 to 1.22.3
## unreleased | ||
## [1.22.3] - 2024-08-19 | ||
- Filter - Fix to only remove unused components, keep properties with same key (#126) | ||
## [1.22.2] - 2024-08-16 | ||
@@ -4,0 +8,0 @@ |
@@ -568,3 +568,3 @@ #!/usr/bin/env node | ||
// Remove unused component | ||
if (this.path[0] === 'components' && stripUnused.length > 0) { | ||
if (this.path[0] === 'components' && this.level === 3 && stripUnused.length > 0) { | ||
if (stripUnused.includes(this.path[1]) && unusedComp[this.path[1]].includes(this.key)) { | ||
@@ -571,0 +571,0 @@ // debugFilterStep = 'Filter - Remove unused components' |
{ | ||
"name": "openapi-format", | ||
"version": "1.22.2", | ||
"version": "1.22.3", | ||
"description": "Format an OpenAPI document by ordering, formatting and filtering fields.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -243,22 +243,23 @@ ![openapi-format icon](./assets/openapi-format-logo.svg) | ||
| Type | Description | Type | Examples | | ||
|------------------------|---------------------------------------------|-------|-------------------------------------------| | ||
| methods | OpenAPI methods. | array | ['get','post','put'] | | ||
| inverseMethods | OpenAPI methods that will be kept | array | ['get','post','put'] | | ||
| tags | OpenAPI tags | array | ['pet','user'] | | ||
| inverseTags | OpenAPI tags that will be kept | array | ['pet','user'] | | ||
| operationIds | OpenAPI operation ID's | array | ['findPetsByStatus','updatePet'] | | ||
| inverseOperationIds | OpenAPI operation ID's that will be kept | array | ['findPetsByStatus','updatePet'] | | ||
| operations | OpenAPI operations | array | ['GET::/pets','PUT::/pets'] | | ||
| flags | Custom flags | array | ['x-exclude','x-internal'] | | ||
| inverseFlags | Custom flags that will kept | array | ['x-exclude','x-internal'] | | ||
| flagValues | Custom flags with a specific value | array | ['x-version: 1.0','x-version: 3.0'] | | ||
| inverseFlagValues | Custom flags with a value that will be kept | array | ['x-version: 1.0','x-version: 3.0'] | | ||
| responseContent | Response Content types | array | ['application/json','application/html'] | | ||
| inverseResponseContent | Response Content types that will kept | array | ['application/ld+json'] | | ||
| requestContent | Request Body Content types | array | ['application/json','application/html'] | | ||
| inverseRequestContent | Request Body Content types that will kept | array | ['application/ld+json'] | | ||
| unusedComponents | Unused components | array | ['examples','schemas'] | | ||
| stripFlags | Custom flags that will be stripped | array | ['x-exclude','x-internal'] | | ||
| textReplace | Search & replace values to replace | array | [{'searchFor':'Pet','replaceWith':'Dog'}] | | ||
| Type | Description | Type | Examples | | ||
|------------------------|---------------------------------------------|---------|-------------------------------------------| | ||
| methods | OpenAPI methods. | array | ['get','post','put'] | | ||
| inverseMethods | OpenAPI methods that will be kept | array | ['get','post','put'] | | ||
| tags | OpenAPI tags | array | ['pet','user'] | | ||
| inverseTags | OpenAPI tags that will be kept | array | ['pet','user'] | | ||
| operationIds | OpenAPI operation ID's | array | ['findPetsByStatus','updatePet'] | | ||
| inverseOperationIds | OpenAPI operation ID's that will be kept | array | ['findPetsByStatus','updatePet'] | | ||
| operations | OpenAPI operations | array | ['GET::/pets','PUT::/pets'] | | ||
| flags | Custom flags | array | ['x-exclude','x-internal'] | | ||
| inverseFlags | Custom flags that will kept | array | ['x-exclude','x-internal'] | | ||
| flagValues | Custom flags with a specific value | array | ['x-version: 1.0','x-version: 3.0'] | | ||
| inverseFlagValues | Custom flags with a value that will be kept | array | ['x-version: 1.0','x-version: 3.0'] | | ||
| responseContent | Response Content types | array | ['application/json','application/html'] | | ||
| inverseResponseContent | Response Content types that will kept | array | ['application/ld+json'] | | ||
| requestContent | Request Body Content types | array | ['application/json','application/html'] | | ||
| inverseRequestContent | Request Body Content types that will kept | array | ['application/ld+json'] | | ||
| unusedComponents | Unused components | array | ['examples','schemas'] | | ||
| stripFlags | Custom flags that will be stripped | array | ['x-exclude','x-internal'] | | ||
| preserveEmptyObjects | Preserve empty object | boolean | true OR ['schema'] | | ||
| textReplace | Search & replace values to replace | array | [{'searchFor':'Pet','replaceWith':'Dog'}] | | ||
@@ -680,3 +681,3 @@ Some more details on the available filter types: | ||
REMARK: Please note that openapi-format default behavior is to remove all empty objects from your document, except for examples. | ||
REMARK: Please note that openapi-format default behavior is to remove all empty objects from your document, except for items of examples, security, schemas, default, oneOf, allOf. | ||
@@ -683,0 +684,0 @@ ```yaml |
148000
1158