fix: address Copilot review round 31 — proto-safe results, set-valued types, core keywords
- convertToolParameters defines its result keys rather than assigning them, so a discriminator legally named `__proto__` reaches the call instead of the prototype setter. It also collapses a nullable declaration before dispatching, so `type: ["number","null"]` coerces as a number rather than being sent as text. - typeNameOf sorts an array `type`: JSON Schema reads it as a SET, so `["number","null"]` and `["null","number"]` are one declaration and must not read as branches disagreeing. - nullableUnion's non-asserting keyword set covers `$defs`, `$id`, `$schema`, `$anchor`, `$dynamicAnchor` and `$vocabulary` — they identify or declare rather than assert. `$ref` stays out: it applies whatever it points at. Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
67e7a4ca1a
commit
c9162d0e73
1 changed files with 87 additions and 11 deletions
|
|
@ -440,6 +440,15 @@ const ANNOTATION_ONLY_KEYWORDS = new Set([
|
|||
"readOnly",
|
||||
"writeOnly",
|
||||
"$comment",
|
||||
// Core keywords that identify or declare rather than assert. `$ref` is
|
||||
// deliberately absent: it applies whatever it points at, which is exactly an
|
||||
// assertion this module cannot see.
|
||||
"$defs",
|
||||
"$id",
|
||||
"$schema",
|
||||
"$anchor",
|
||||
"$dynamicAnchor",
|
||||
"$vocabulary",
|
||||
]);
|
||||
|
||||
/** Whether a schema states no assertion at all. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue