From a1dc2270a26351eb2c7e01e4198713a6867431ab Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Sun, 8 Mar 2026 17:36:58 -0300 Subject: [PATCH] fix(gemini): remove "optional" field from schema to fix Gemini API rejection (#244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Gemini API rejects JSON schemas containing the "optional" field, returning "400: Cannot find field: optional". Added "optional" to UNSUPPORTED_SCHEMA_CONSTRAINTS in geminiHelper.ts so it is recursively stripped before sending to upstream. Also: update star history section in README — embed replaced with live link since api.star-history.com was suspended by GitHub in March 2025. Closes #244 --- README.md | 2 ++ open-sse/translator/helpers/geminiHelper.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 7e5b3f7961..9022c12d5a 100644 --- a/README.md +++ b/README.md @@ -1693,6 +1693,8 @@ gh release create v2.0.0 --title "v2.0.0" --generate-notes +> 📈 **[View live star history on star-history.com](https://star-history.com/#diegosouzapw/OmniRoute&Date)** — The embedded chart may be cached. Click the link for real-time data. + --- ## 🙏 Acknowledgments diff --git a/open-sse/translator/helpers/geminiHelper.ts b/open-sse/translator/helpers/geminiHelper.ts index af00d0aa13..8fe75e4688 100644 --- a/open-sse/translator/helpers/geminiHelper.ts +++ b/open-sse/translator/helpers/geminiHelper.ts @@ -41,6 +41,8 @@ export const UNSUPPORTED_SCHEMA_CONSTRAINTS = [ "else", "contentMediaType", "contentEncoding", + // Non-standard schema fields (not recognized by Gemini API) + "optional", // UI/Styling properties (from Cursor tools - NOT JSON Schema standard) "cornerRadius", "fillColor",