{"record":{"id":"3bb90093145e9479","repo":"larksuite/cli","slug":"s-items-is-required","errorCode":null,"errorMessage":"%s.Items is required","messagePattern":"(.+?)\\.Items is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_data.go","lineNumber":290,"sourceCode":"\t\t\treturn fmt.Errorf(\"%s minimum exceeds maximum\", path)\n\t\t}\n\tcase typedNumberShape:\n\t\tfor _, number := range append(append([]float64{}, value.Enum...), pointerFloats(value.Minimum, value.Maximum)...) {\n\t\t\tif math.IsNaN(number) || math.IsInf(number, 0) {\n\t\t\t\treturn fmt.Errorf(\"%s number constraints must be finite\", path)\n\t\t\t}\n\t\t}\n\t\tif value.Minimum != nil && value.Maximum != nil && *value.Minimum > *value.Maximum {\n\t\t\treturn fmt.Errorf(\"%s minimum exceeds maximum\", path)\n\t\t}\n\tcase typedNullShape:\n\tcase typedConstShape:\n\t\tif _, err := json.Marshal(value.Value); err != nil {\n\t\t\treturn fmt.Errorf(\"%s const is not JSON-encodable: %w\", path, err)\n\t\t}\n\tcase typedArrayShape:\n\t\tif value.Items == nil {\n\t\t\treturn fmt.Errorf(\"%s.Items is required\", path)\n\t\t}\n\t\tif value.MinItems != nil && *value.MinItems < 0 || value.MaxItems != nil && *value.MaxItems < 0 {\n\t\t\treturn fmt.Errorf(\"%s item lengths must be nonnegative\", path)\n\t\t}\n\t\tif value.MinItems != nil && value.MaxItems != nil && *value.MinItems > *value.MaxItems {\n\t\t\treturn fmt.Errorf(\"%s minItems exceeds maxItems\", path)\n\t\t}\n\t\treturn validateShape(value.Items, path+\".Items\")\n\tcase typedObjectShape:\n\t\tseen := make(map[string]struct{})\n\t\tfor i := range value.Fields {\n\t\t\tfield := &value.Fields[i]\n\t\t\tif field.Name == \"\" {\n\t\t\t\treturn fmt.Errorf(\"%s.Fields[%d].Name is required\", path, i)\n\t\t\t}\n\t\t\tif _, duplicate := seen[field.Name]; duplicate {\n\t\t\t\treturn fmt.Errorf(\"%s contains duplicate field %q\", path, field.Name)\n\t\t\t}","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_data.go#L272-L308","documentation":"validateShape rejects a typedArrayShape whose Items shape is nil. Every array shape must declare the shape of its elements so the generated schema can describe item constraints; a nil Items is reported with the array's path plus the '.Items' suffix convention.","triggerScenarios":"An explicit Output.Data.Shape or DataField.Shape override constructs typedArrayShape{} without setting Items; a programmatic shape builder returns nil for the element shape; validateShape recursion reaches the array during compileData.","commonSituations":"Hand-writing an array shape literal and forgetting the element type; refactoring that removed an Items assignment; copy-pasting a shape template and leaving the placeholder nil.","solutions":["Find the array shape at the reported path (the error is raised as '<path>.Items is required').","Set Items to a concrete shape, e.g. typedStringShape{} or a nested typedObjectShape.","For heterogeneous items, use typedOneOfShape with at least two variants as Items.","Cover the shape literal in a test that runs the compile path."],"exampleFix":"// before\nshape := typedArrayShape{} // Items missing\n// after\nshape := typedArrayShape{Items: typedStringShape{}}","handlingStrategy":"validation","validationCode":"func arrayItemsSet(s typedValueShape) error {\n    if arr, ok := s.(typedArrayShape); ok && arr.Items == nil {\n        return errors.New(\"array shape missing Items\")\n    }\n    return nil\n}\n// if err := arrayItemsSet(shape); err != nil { return err }","typeGuard":"func isArrayShapeWithItems(s typedValueShape) bool {\n    arr, ok := s.(typedArrayShape)\n    return ok && arr.Items != nil\n}","tryCatchPattern":null,"preventionTips":["Always construct array shapes through a helper that requires an Items argument.","Use a constructor like newArrayShape(items typedValueShape, min, max *int) so the nil case cannot compile.","Cover every declared shape with a validateShape test in CI."],"tags":["go","schema","validation","array-shape"],"backgroundTag":"missing-items-schema","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"}