{"record":{"id":"fbac7d5ebd40e816","repo":"weaviate/weaviate","slug":"invalid-object-d-in-array-w","errorCode":null,"errorMessage":"invalid object '%d' in array: %w","messagePattern":"invalid object '(.+?)' in array: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/objects/validation/properties_validation.go","lineNumber":243,"sourceCode":"\t\t}\n\t\ttyped[nestedKey] = data\n\t}\n\n\treturn typed, nil\n}\n\nfunc objectArrayVal(ctx context.Context, v *Validator, val interface{}, propertyPrefix string,\n\tclassName string, nestedPropertiesMap map[string]*models.NestedProperty,\n) (interface{}, error) {\n\ttyped, ok := val.([]interface{})\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"not an object array, but %T\", val)\n\t}\n\n\tfor i := range typed {\n\t\tdata, err := objectVal(ctx, v, typed[i], propertyPrefix, className, nestedPropertiesMap)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid object '%d' in array: %w\", i, err)\n\t\t}\n\t\ttyped[i] = data\n\t}\n\n\treturn typed, nil\n}\n\nfunc (v *Validator) extractAndValidateProperty(ctx context.Context, propertyName string, pv interface{},\n\tclassName string, dataType *schema.DataType, tenant string,\n) (interface{}, error) {\n\tvar (\n\t\tdata interface{}\n\t\terr  error\n\t)\n\n\tswitch *dataType {\n\tcase schema.DataTypeCRef:\n\t\tdata, err = v.cRef(ctx, propertyName, pv, className, tenant)","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/objects/validation/properties_validation.go#L225-L261","documentation":"While validating elements of an object[] property, element %d failed nested-object validation. This wrapper adds the array index to the wrapped objectVal error so the offending element in a long array can be identified.","triggerScenarios":"Thrown at usecases/objects/validation/properties_validation.go:243 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the reported index to find the exact element, then fix per the wrapped error (type mismatch, unknown key, etc.).","Validate array elements client-side before batch writes.","Remove null/malformed elements from object arrays."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}