From 7ab810a0e59fa86cc4bec7f7e841f89a1d61afed Mon Sep 17 00:00:00 2001 From: bbbugg Date: Mon, 26 Jan 2026 20:29:30 +0800 Subject: [PATCH 1/2] fix: extend unsupported keys blacklist in FormatConverter for improved schema validation --- src/core/FormatConverter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/FormatConverter.js b/src/core/FormatConverter.js index 610b0be..1950fe5 100644 --- a/src/core/FormatConverter.js +++ b/src/core/FormatConverter.js @@ -514,7 +514,7 @@ class FormatConverter { for (const key of Object.keys(obj)) { // 1. Filter out unsupported fields using a blacklist approach // This allows potentially valid fields to pass through while blocking known problematic ones - const unsupportedKeys = ["$schema", "additionalProperties"]; + const unsupportedKeys = ["$schema", "additionalProperties", "ref", "$ref"]; if (isResponseSchema) { // For Structured Outputs: stricter filtering of metadata that causes 400 errors From 41c965c786f46e3284f1f842413ace9f93eafa19 Mon Sep 17 00:00:00 2001 From: bbbugg Date: Mon, 26 Jan 2026 22:58:04 +0800 Subject: [PATCH 2/2] fix: extend unsupported keys blacklist in FormatConverter for improved schema validation --- src/core/FormatConverter.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/FormatConverter.js b/src/core/FormatConverter.js index 1950fe5..436cdfc 100644 --- a/src/core/FormatConverter.js +++ b/src/core/FormatConverter.js @@ -514,11 +514,19 @@ class FormatConverter { for (const key of Object.keys(obj)) { // 1. Filter out unsupported fields using a blacklist approach // This allows potentially valid fields to pass through while blocking known problematic ones - const unsupportedKeys = ["$schema", "additionalProperties", "ref", "$ref"]; + const unsupportedKeys = [ + "$schema", + "additionalProperties", + "ref", + "$ref", + "propertyNames", + "patternProperties", + "unevaluatedProperties", + ]; if (isResponseSchema) { // For Structured Outputs: stricter filtering of metadata that causes 400 errors - unsupportedKeys.push("title", "default", "examples", "$defs", "id", "patternProperties"); + unsupportedKeys.push("title", "default", "examples", "$defs", "id"); } if (unsupportedKeys.includes(key)) {