larksuite/cli · error
L1: array property %q items (nested array) missing items
Error message
L1: array property %q items (nested array) missing items
What it means
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.
Source
Thrown at internal/schema/lint.go:180
validatePropertyTypes(p.Properties, errs)
}
// Validate the array-element schema itself, not only its child
// properties — a primitive element with an invalid type (e.g.
// `items.type = "list"`) would otherwise slip past lint.
if p.Items != nil {
validateItemSchema(k, p.Items, errs)
}
}
}
// validateItemSchema checks a single array element schema for invalid types,
// then recurses into any further nested properties/items.
func validateItemSchema(parentKey string, item *Property, errs *[]error) {
if item.Type != "" && !validJSONSchemaTypes[item.Type] {
*errs = append(*errs, fmt.Errorf("L1: array property %q items has invalid type %q", parentKey, item.Type))
}
if item.Type == "array" && item.Items == nil {
*errs = append(*errs, fmt.Errorf("L1: array property %q items (nested array) missing items", parentKey))
}
if item.Properties != nil {
validatePropertyTypes(item.Properties, errs)
}
if item.Items != nil {
validateItemSchema(parentKey, item.Items, errs)
}
}
// coverageBaseline is the per-metric warn threshold for L4 coverage checks.
// If the measured rate drops below the baseline, t.Logf emits a warning but
// does NOT fail the test. Adjust these constants upward as meta_data quality
// improves over time.
var coverageBaseline = map[string]float64{
"description": 0.99,
"scopes": 1.00,
"doc_url": 0.98,
"risk": 0.96,View on GitHub (pinned to 7fd6ef3c07)
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
Example fix
// before
Items: &Property{Type: "array"}
// after
Items: &Property{Type: "array", Items: &Property{Type: "string"}} Defensive patterns
Strategy: type-guard
Validate before calling
func checkNestedArrays(p *Property) error {
if p.Type == "array" && p.Items == nil {
return fmt.Errorf("nested array missing items")
}
if p.Items != nil {
return checkNestedArrays(p.Items)
}
return nil
} Type guard
func allArrayLevelsHaveItems(p *Property) bool {
if p.Type != "array" { return true }
return p.Items != nil && allArrayLevelsHaveItems(p.Items)
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: Two-dimensional list parameters where only the outer items were defined; recursive schema generation that stops after one level.
Related errors
- L1: array property %q missing items
- L1: array property %q items has invalid type %q
- L2: field %q has format: binary but type = %q (want string)
- L2: field %q minimum (%v) >= maximum (%v)
- L2: field %q enumDescriptions length (%d) != enum length (%d
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/a7da1298c42aac59.
Report an issue: GitHub.