fix: disable strict mode for enhancement JSON schema (#99)

strict: true requires all property names to be known upfront,
which is incompatible with the dynamic-key maps in slotFills.
Also replace type array with anyOf for nullable slot values.
This commit is contained in:
2026-03-28 15:58:57 +00:00
committed by GitHub
parent 21b7d299a6
commit e09c606649
3 changed files with 8 additions and 7 deletions

View File

@@ -166,11 +166,12 @@ describe("schema sync", () => {
expect(parseEnhancementResult(JSON.stringify(bad))).toBeNull()
// JSON Schema only allows string or null for slot values
const slotValueTypes =
const slotValueSchema =
enhancementResultJsonSchema.properties.slotFills.additionalProperties
.additionalProperties.type
expect(slotValueTypes).toContain("string")
expect(slotValueTypes).toContain("null")
expect(slotValueTypes).not.toContain("number")
.additionalProperties
expect(slotValueSchema.anyOf).toEqual([
{ type: "string" },
{ type: "null" },
])
})
})