fix: guard gemini schema null properties (#32332) (thanks @webdevtodayjason)

This commit is contained in:
Peter Steinberger
2026-03-03 01:11:51 +00:00
parent 1a7a18d0bc
commit ddd71bc9f6
2 changed files with 10 additions and 0 deletions

View File

@@ -21,6 +21,15 @@ describe("cleanSchemaForGemini", () => {
expect(cleaned.properties).toEqual({});
});
it("coerces array properties to an empty object", () => {
const cleaned = cleanSchemaForGemini({
type: "object",
properties: [],
}) as { properties?: unknown };
expect(cleaned.properties).toEqual({});
});
it("coerces nested null properties while preserving valid siblings", () => {
const cleaned = cleanSchemaForGemini({
type: "object",