mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 12:20:52 +08:00
fix: remove propertyNames from JSON schema for Gemini compatibility
Gemini API does not support the JSON Schema `propertyNames` keyword, causing 400 errors when Claude tool schemas containing this field are proxied through the Antigravity provider. Add `propertyNames` to the list of unsupported keywords removed by CleanJSONSchemaForGemini(), alongside existing removals like $ref, definitions, and additionalProperties.
This commit is contained in:
@@ -296,6 +296,7 @@ func flattenTypeArrays(jsonStr string) string {
|
||||
func removeUnsupportedKeywords(jsonStr string) string {
|
||||
keywords := append(unsupportedConstraints,
|
||||
"$schema", "$defs", "definitions", "const", "$ref", "additionalProperties",
|
||||
"propertyNames", // Gemini doesn't support property name validation
|
||||
)
|
||||
for _, key := range keywords {
|
||||
for _, p := range findPaths(jsonStr, key) {
|
||||
|
||||
Reference in New Issue
Block a user