fix(tools): harden unified JSON value boundaries

This commit is contained in:
Tianyi Cui
2026-07-21 17:44:46 +08:00
parent 0c50ed9f8e
commit 4574340d7a
22 changed files with 155 additions and 31 deletions
+6 -1
View File
@@ -197,7 +197,12 @@ function compilePropertyMap(
if (Object.hasOwn(property, 'required') && property.required !== true) {
authorError(`${path}.${key}.required must be true when present`)
}
properties[key] = compileValueSchema(property, `${path}.${key}`, seen, true)
Object.defineProperty(properties, key, {
value: compileValueSchema(property, `${path}.${key}`, seen, true),
enumerable: true,
configurable: true,
writable: true,
})
if (property.required === true) required.push(key)
}
return required.length > 0 ? { properties, required } : { properties }