Skip to content

Commit

Permalink
fix(overlay): backport of an upstream fix for remove action
Browse files Browse the repository at this point in the history
This commit is a backport of
https://github.com/lornajane/openapi-overlays-js/pull/13/files.

To fix the issue of applying `remove` action on a target which is a
list. Before the fix it would remove only the first occurence of the
target. With this fix it removes all the occurences of the target
JSONPath.
  • Loading branch information
paulRbr committed Aug 2, 2024
1 parent 4b935e5 commit 0f8b101
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Overlay {
// Is it a remove?
if (action.hasOwnProperty('remove')) {
while (true) {
const path = jsonpath.paths(spec, target, 1);
const path = jsonpath.paths(spec, target);
if (path.length == 0) {
break;
}
Expand Down

0 comments on commit 0f8b101

Please sign in to comment.