Skip to content

Commit ea4db77

Browse files
committed
for removing endpoints using badge-labels ignore case
1 parent 26a7e97 commit ea4db77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/spec-parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function filterPaths(openApiObject, matchPaths = '', matchType = '', removeEndpo
176176
const filteredPaths = {};
177177

178178
// Convert the removePathsWithBadgeLabeledAs to an array if provided
179-
const labelsToRemove = removeEndpointsWithBadgeLabelAs.split(',').map((label) => label.trim()).filter(Boolean);
179+
const labelsToRemove = removeEndpointsWithBadgeLabelAs.split(',').map((label) => label.trim().toLowerCase()).filter(Boolean);
180180

181181
// Helper function to check if a path should be included based on matchPaths
182182
function pathMatches(pathsKey, httpMethod) {
@@ -193,7 +193,7 @@ function filterPaths(openApiObject, matchPaths = '', matchType = '', removeEndpo
193193

194194
// Helper function to check if the badges contain any label that needs to be removed
195195
function containsLabelToRemove(badges) {
196-
return badges.some((badge) => labelsToRemove.includes(badge.label));
196+
return badges.some((badge) => labelsToRemove.includes(badge?.label.toLowerCase()));
197197
}
198198

199199
// Loop through the paths in the openApiObject

0 commit comments

Comments
 (0)