Skip to content

Commit caf79b5

Browse files
fix: modify script
Changes: - adjust script according to suggestion: #1059 (comment)
1 parent fd16aef commit caf79b5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/validation/embedded-examples-validation.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@ const combinedData = extractCommentsAndExamples(markdownContent);
5151
function applyUpdates(updates, baseDoc) {
5252
updates.forEach(update => {
5353
try {
54-
5554
// Handle root document case
56-
if (jsonPointerPath === '') {
55+
if (update.json_pointer === '') {
5756
baseDoc = mergePatch.apply(baseDoc, update.example);
5857
return;
5958
}
6059

6160
// For non-root cases, use jsonpointer to get and set the correct location
62-
const targetObject = jsonpointer.get(baseDoc, jsonPointerPath);
61+
const targetObject = jsonpointer.get(baseDoc, update.json_pointer);
6362
const updatedObject = mergePatch.apply(targetObject || {}, update.example);
64-
jsonpointer.set(baseDoc, jsonPointerPath, updatedObject);
63+
jsonpointer.set(baseDoc, update.json_pointer, updatedObject);
6564

6665
} catch (e) {
6766
console.error(`\nError processing update for '${update.name}' at path '${update.json_pointer}'`, e);

0 commit comments

Comments
 (0)