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

  1. Set item.Items to a schema describing the inner elements
  2. Flatten the structure to a single-level array if nesting is unnecessary
  3. 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

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


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/a7da1298c42aac59. Report an issue: GitHub.