mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
test(mcp): accept type-array unions in the strict output-schema check
This commit is contained in:
1 parent
a17f85c050
commit
d2a806364b
1 file changed
+9
-1
@@ -416,7 +416,15 @@ describe("MCP tool outputs against their advertised schemas", () => {
|
||||
.filter((name) => !(name in CASES));
|
||||
expect(uncovered, "add every new tool to CASES").toEqual([]);
|
||||
|
||||
const ajv = new Ajv2020({ strict: true, allErrors: true });
|
||||
// `allowUnionTypes`: zod 4.6 writes a nullable or primitive union as a
|
||||
// `type` array (`["string", "null"]`), which is plain 2020-12. Strict
|
||||
// mode otherwise refuses that spelling as an authoring style, not as an
|
||||
// invalid schema; every other strict rule stays on.
|
||||
const ajv = new Ajv2020({
|
||||
strict: true,
|
||||
allowUnionTypes: true,
|
||||
allErrors: true,
|
||||
});
|
||||
const failures: string[] = [];
|
||||
let validated = 0;
|
||||
// Tools that answered with data, not only a miss: a run where every
|
||||
|
||||
Reference in new issue
Block a user