{"record":{"id":"48ead759d6beb612","repo":"larksuite/cli","slug":"l1-array-property-q-missing-items","errorCode":null,"errorMessage":"L1: array property %q missing items","messagePattern":"L1: array property %q missing items","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/schema/lint.go","lineNumber":159,"sourceCode":"\t}\n}\n\n// validatePropertyTypes walks an OrderedProps tree and asserts:\n//   - every Property.Type is in validJSONSchemaTypes (or empty for nested objects with only properties)\n//   - array Properties have Items\n//\n// Errors are appended to *errs.\nfunc validatePropertyTypes(props *OrderedProps, errs *[]error) {\n\tif props == nil {\n\t\treturn\n\t}\n\tfor _, k := range props.Order {\n\t\tp := props.Map[k]\n\t\tif p.Type != \"\" && !validJSONSchemaTypes[p.Type] {\n\t\t\t*errs = append(*errs, fmt.Errorf(\"L1: property %q has invalid type %q\", k, p.Type))\n\t\t}\n\t\tif p.Type == \"array\" && p.Items == nil {\n\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))","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/schema/lint.go#L141-L177","documentation":"L1 schema lint failure: a property with type \"array\" lacks an items schema. Every array property must describe its element type for generated schemas to be valid.","triggerScenarios":"p.Type == \"array\" and p.Items == nil — an array field declared without an items schema at any nesting depth.","commonSituations":"Declaring list parameters hastily; converting a string field to an array without adding items; generators that emit type:array and forget items.","solutions":["Add an Items schema (e.g. &Property{Type: \"string\"}) to the array property","Change the type if the field is not really an array","Regenerate the schema from upstream metadata including element types"],"exampleFix":"// before\nProperty{Type: \"array\"}\n// after\nProperty{Type: \"array\", Items: &Property{Type: \"string\"}}","handlingStrategy":"type-guard","validationCode":"if p.Type == \"array\" && p.Items == nil {\n  return fmt.Errorf(\"array property %s missing items\", name)\n}","typeGuard":"func isWellFormedArray(p *Property) bool { return p.Type != \"array\" || p.Items != nil }","tryCatchPattern":null,"preventionTips":["Never declare type:array without an Items schema","Build arrays via a helper that forces an element schema","Run the L1 lint tests when converting fields to arrays"],"tags":["json-schema","lint","array"],"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"}