Skip to content

Commit

Permalink
data in changeCallback for /foo/- should be /foo
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Hendrey committed Feb 21, 2024
1 parent 11ee361 commit d113976
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/TemplateProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,7 @@ export default class TemplateProcessor {
}else{
if(jsonPointer.endsWith("/-")){ //happens when we patch an array like /foo/myarray/- indicating "append"
_jsonPointer = jsonPointer.split("/-")[0]; //ditch the trailing /-
data = jp.get(this.output, _jsonPointer); //this may be somewhat of a hack, but /foo/myarray/- is not an actual json pointer. It is the array itself that is the changed data
}else {
_jsonPointer = jsonPointer;
}
Expand Down

0 comments on commit d113976

Please sign in to comment.