{"record":{"id":"8ba95f99a9c5a32a","repo":"larksuite/cli","slug":"l1-array-property-q-items-has-invalid-type-q","errorCode":null,"errorMessage":"L1: array property %q items has invalid type %q","messagePattern":"L1: array property %q items has invalid type %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/schema/lint.go","lineNumber":177,"sourceCode":"\t\t\t*errs = append(*errs, fmt.Errorf(\"L1: array property %q missing items\", k))\n\t\t}\n\t\tif p.Properties != nil {\n\t\t\tvalidatePropertyTypes(p.Properties, errs)\n\t\t}\n\t\t// Validate the array-element schema itself, not only its child\n\t\t// properties — a primitive element with an invalid type (e.g.\n\t\t// `items.type = \"list\"`) would otherwise slip past lint.\n\t\tif p.Items != nil {\n\t\t\tvalidateItemSchema(k, p.Items, errs)\n\t\t}\n\t}\n}\n\n// validateItemSchema checks a single array element schema for invalid types,\n// then recurses into any further nested properties/items.\nfunc validateItemSchema(parentKey string, item *Property, errs *[]error) {\n\tif item.Type != \"\" && !validJSONSchemaTypes[item.Type] {\n\t\t*errs = append(*errs, fmt.Errorf(\"L1: array property %q items has invalid type %q\", parentKey, item.Type))\n\t}\n\tif item.Type == \"array\" && item.Items == nil {\n\t\t*errs = append(*errs, fmt.Errorf(\"L1: array property %q items (nested array) missing items\", parentKey))\n\t}\n\tif item.Properties != nil {\n\t\tvalidatePropertyTypes(item.Properties, errs)\n\t}\n\tif item.Items != nil {\n\t\tvalidateItemSchema(parentKey, item.Items, errs)\n\t}\n}\n\n// coverageBaseline is the per-metric warn threshold for L4 coverage checks.\n// If the measured rate drops below the baseline, t.Logf emits a warning but\n// does NOT fail the test. Adjust these constants upward as meta_data quality\n// improves over time.\nvar coverageBaseline = map[string]float64{\n\t\"description\": 0.99,","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/schema/lint.go#L159-L195","documentation":"validateItemSchema checks the array element schema itself (not just child properties): items.type is set but is not one of the valid JSON Schema types, e.g. `items.type = \"list\"` - precisely the gap this per-element validation closes.","triggerScenarios":"validateItemSchema is invoked (from validatePropertyTypes for an array property, or recursively for nested items) with item.Type non-empty and not in validJSONSchemaTypes — e.g. array of elements typed \"list\".","commonSituations":"Typo in an element type; assuming Go types carry over; nested arrays where the inner items type was mistyped.","solutions":["Fix the item type to a valid JSON Schema type (string, number, integer, boolean, array, object)","Remove the invalid Type if elements are untyped","Fix the generator that emitted the element schema"],"exampleFix":"// before\nProperty{Type: \"array\", Items: &Property{Type: \"float\"}}\n// after\nProperty{Type: \"array\", Items: &Property{Type: \"number\"}}","handlingStrategy":"type-guard","validationCode":"if item.Type != \"\" && !validJSONSchemaTypes[item.Type] {\n  return fmt.Errorf(\"items of %s have invalid type %q\", parentKey, item.Type)\n}","typeGuard":"func hasValidItemType(item *Property) bool { return item.Type == \"\" || validJSONSchemaTypes[item.Type] }","tryCatchPattern":null,"preventionTips":["Validate element types, not just top-level property types","Use the same valid-type set for items and properties","Cover nested arrays in lint tests"],"tags":["json-schema","lint","array","type"],"backgroundTag":"json-schema-type-mismatch","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}