{"record":{"id":"a7da1298c42aac59","repo":"larksuite/cli","slug":"l1-array-property-q-items-nested-array-missing","errorCode":null,"errorMessage":"L1: array property %q items (nested array) missing items","messagePattern":"L1: array property %q items \\(nested array\\) missing items","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/schema/lint.go","lineNumber":180,"sourceCode":"\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,\n\t\"scopes\":      1.00,\n\t\"doc_url\":     0.98,\n\t\"risk\":        0.96,","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/schema/lint.go#L162-L198","documentation":"L1 schema lint failure: an array property's items schema is itself typed \"array\" but has no nested items schema. Nested arrays must also declare their element schema.","triggerScenarios":"validateItemSchema encounters an item whose Type is \"array\" and whose Items is nil (e.g. array of arrays where the inner element schema was omitted).","commonSituations":"Two-dimensional list parameters where only the outer items were defined; recursive schema generation that stops after one level.","solutions":["Set item.Items to a schema describing the inner elements","Flatten the structure to a single-level array if nesting is unnecessary","Fix the generator to emit items for every array level"],"exampleFix":"// before\nItems: &Property{Type: \"array\"}\n// after\nItems: &Property{Type: \"array\", Items: &Property{Type: \"string\"}}","handlingStrategy":"type-guard","validationCode":"func checkNestedArrays(p *Property) error {\n  if p.Type == \"array\" && p.Items == nil {\n    return fmt.Errorf(\"nested array missing items\")\n  }\n  if p.Items != nil {\n    return checkNestedArrays(p.Items)\n  }\n  return nil\n}","typeGuard":"func allArrayLevelsHaveItems(p *Property) bool {\n  if p.Type != \"array\" { return true }\n  return p.Items != nil && allArrayLevelsHaveItems(p.Items)\n}","tryCatchPattern":null,"preventionTips":["Give every array level its own items schema, not just the outermost","Avoid unnecessary arrays-of-arrays; flatten when possible","Add recursive array schemas to lint test fixtures"],"tags":["json-schema","lint","array","nested"],"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"}