larksuite/cli · error

%s minItems exceeds maxItems

Error message

%s minItems exceeds maxItems

What it means

Shape validation guard: a typed array shape declares minItems greater than maxItems, an unsatisfiable length range.

Source

Thrown at shortcuts/common/typed_compile_data.go:296

			}
		}
		if value.Minimum != nil && value.Maximum != nil && *value.Minimum > *value.Maximum {
			return fmt.Errorf("%s minimum exceeds maximum", path)
		}
	case typedNullShape:
	case typedConstShape:
		if _, err := json.Marshal(value.Value); err != nil {
			return fmt.Errorf("%s const is not JSON-encodable: %w", path, err)
		}
	case typedArrayShape:
		if value.Items == nil {
			return fmt.Errorf("%s.Items is required", path)
		}
		if value.MinItems != nil && *value.MinItems < 0 || value.MaxItems != nil && *value.MaxItems < 0 {
			return fmt.Errorf("%s item lengths must be nonnegative", path)
		}
		if value.MinItems != nil && value.MaxItems != nil && *value.MinItems > *value.MaxItems {
			return fmt.Errorf("%s minItems exceeds maxItems", path)
		}
		return validateShape(value.Items, path+".Items")
	case typedObjectShape:
		seen := make(map[string]struct{})
		for i := range value.Fields {
			field := &value.Fields[i]
			if field.Name == "" {
				return fmt.Errorf("%s.Fields[%d].Name is required", path, i)
			}
			if _, duplicate := seen[field.Name]; duplicate {
				return fmt.Errorf("%s contains duplicate field %q", path, field.Name)
			}
			seen[field.Name] = struct{}{}
			if strings.TrimSpace(field.Description) == "" {
				return fmt.Errorf("%s field %q Description is required", path, field.Name)
			}
			if err := validateShape(field.Shape, path+"/"+field.Name); err != nil {
				return err

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Set minItems <= maxItems on the array shape
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at shortcuts/common/typed_compile_data.go:296 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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