History

Merge pull request #2142 from Muran-prog/fix/strip-uniqueItems-gemini-2123

Luis Pater committed 8 months ago

Commit fb958132 parents db63f9b 152c3102 files · +25 −1Browse files

Unified · Split

2 files
  1. internal/util/gemini_schema.go +1 −1
  2. internal/util/gemini_schema_test.go +24 −0
internal/util/gemini_schema.go+1−1
@@ -236,7 +236,7 @@ func addAdditionalPropertiesHints(jsonStr string) string { · 235 unmodified lines
236 236
237var unsupportedConstraints = []string{237var unsupportedConstraints = []string{
238 "minLength", "maxLength", "exclusiveMinimum", "exclusiveMaximum",238 "minLength", "maxLength", "exclusiveMinimum", "exclusiveMaximum",
239 "pattern", "minItems", "maxItems", "format",239 "pattern", "minItems", "maxItems", "uniqueItems", "format",
240 "default", "examples", // Claude rejects these in VALIDATED mode240 "default", "examples", // Claude rejects these in VALIDATED mode
241}241}
242 242
internal/util/gemini_schema_test.go+24−0
@@ -1046,3 +1046,27 @@ func TestRemoveExtensionFields(t *testing.T) { · 1045 unmodified lines
1046 })1046 })
1047 }1047 }
1048}1048}
1049
1050// uniqueItems should be stripped and moved to description hint (#2123).
1051func TestCleanJSONSchemaForAntigravity_UniqueItemsStripped(t *testing.T) {
1052 input := `{
1053 "type": "object",
1054 "properties": {
1055 "ids": {
1056 "type": "array",
1057 "description": "Unique identifiers",
1058 "items": {"type": "string"},
1059 "uniqueItems": true
1060 }
1061 }
1062 }`
1063
1064 result := CleanJSONSchemaForAntigravity(input)
1065
1066 if strings.Contains(result, `"uniqueItems"`) {
1067 t.Errorf("uniqueItems should be removed from schema")
1068 }
1069 if !strings.Contains(result, "uniqueItems: true") {
1070 t.Errorf("uniqueItems hint missing in description")
1071 }
1072}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t