fix(mcp): emit valid schemas for empty arrays (#535)
Replace empty tuples with a shared empty-array schema. Validate all input and output schemas against Draft 2020-12 during catalog generation and packaged MCP verification, with runtime and catalog regression coverage. Closes #528 Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { emptyArraySchema } from "./emptyArraySchema.js";
|
||||
import { evidenceSchema } from "./evidence.js";
|
||||
import { cliMetadataGuidSchema } from "./managedArtifact.js";
|
||||
|
||||
@@ -72,7 +73,7 @@ export const pinvokeVerificationSchema = z.discriminatedUnion("status", [
|
||||
basis: z.enum(["no-native-candidate", "unsupported-native-evidence"]),
|
||||
confidence: z.literal("unknown"),
|
||||
matched_native: z.null(),
|
||||
candidates: z.tuple([]),
|
||||
candidates: emptyArraySchema,
|
||||
}),
|
||||
z.strictObject({
|
||||
...pinvokeVerificationContextShape,
|
||||
|
||||
Reference in New Issue
Block a user