{"record":{"id":"487ef16f29df8bb6","repo":"weaviate/weaviate","slug":"invalid-ref-type-needs-to-be-map-got-t","errorCode":null,"errorMessage":"invalid ref type. Needs to be []map, got %T","messagePattern":"invalid ref type\\. Needs to be \\[\\]map, got %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/objects/validation/properties_validation.go","lineNumber":390,"sourceCode":"\t\tcrefs := models.MultipleRef{}\n\t\tfor _, ref := range refValue {\n\t\t\trefTyped, ok := ref.(map[string]interface{})\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"multiple references in %s.%s should be a list of maps, but we got: %T\",\n\t\t\t\t\tclassName, propertyName, ref)\n\t\t\t}\n\n\t\t\tcref, err := v.parseAndValidateSingleRef(ctx, propertyName, refTyped, className, tenant)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tcrefs = append(crefs, cref)\n\t\t}\n\n\t\treturn crefs, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid ref type. Needs to be []map, got %T\", pv)\n\t}\n}\n\nfunc stringVal(val interface{}) (string, error) {\n\ttyped, ok := val.(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"not a string, but %T\", val)\n\t}\n\n\treturn typed, nil\n}\n\nfunc boolVal(val interface{}) (bool, error) {\n\ttyped, ok := val.(bool)\n\tif !ok {\n\t\treturn false, fmt.Errorf(\"not a bool, but %T\", val)\n\t}\n","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/objects/validation/properties_validation.go#L372-L408","documentation":"The whole reference property value matched neither map nor []interface{} in cRef's type switch default — e.g. a plain string, number, or null was sent for a cref property. A terminal shape guard: no ref structure to validate at all.","triggerScenarios":"Thrown at usecases/objects/validation/properties_validation.go:390 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send references as an array of {\"beacon\": ...} objects.","Do not send bare beacon strings or UUIDs for cref properties.","Check for null/undefined creeping into ref fields from client code."],"exampleFix":null,"handlingStrategy":"type-guard","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"}