{"record":{"id":"d8cb02327b06a558","repo":"grpc-ecosystem/grpc-gateway","slug":"not-an-aggregate-type-s-in-s","errorCode":null,"errorMessage":"not an aggregate type: %s in %s","messagePattern":"not an aggregate type: (.+?) in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/descriptor/services.go","lineNumber":337,"sourceCode":"func (r *Registry) resolveFieldPath(msg *Message, path string, isPathParam bool) ([]FieldPathComponent, error) {\n\tif path == \"\" {\n\t\treturn nil, nil\n\t}\n\n\troot := msg\n\tvar result []FieldPathComponent\n\tfor i, c := range strings.Split(path, \".\") {\n\t\tif i > 0 {\n\t\t\tf := result[i-1].Target\n\t\t\tswitch f.GetType() {\n\t\t\tcase descriptorpb.FieldDescriptorProto_TYPE_MESSAGE, descriptorpb.FieldDescriptorProto_TYPE_GROUP:\n\t\t\t\tvar err error\n\t\t\t\tmsg, err = r.LookupMsg(msg.FQMN(), f.GetTypeName())\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"not an aggregate type: %s in %s\", f.GetName(), path)\n\t\t\t}\n\t\t}\n\n\t\tif grpclog.V(2) {\n\t\t\tgrpclog.Infof(\"Lookup %s in %s\", c, msg.FQMN())\n\t\t}\n\t\tf := lookupField(msg, c)\n\t\tif f == nil {\n\t\t\treturn nil, fmt.Errorf(\"no field %q found in %s\", path, root.GetName())\n\t\t}\n\t\tresult = append(result, FieldPathComponent{Name: c, Target: f})\n\t}\n\treturn result, nil\n}\n","sourceCodeStart":319,"sourceCodeEnd":352,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/descriptor/services.go#L319-L352","documentation":"Path-traversal error from Registry.resolveFieldPath: while walking a dotted field path, an intermediate component resolved to a non-message field (scalar/enum), yet more path components follow. Only message/group fields can be descended into, so the path like 'scalar_field.sub' is invalid; the error names the offending field and full path.","triggerScenarios":"Thrown at internal/descriptor/services.go:337 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove extra path components after the scalar field, or reorder the path so intermediate components are messages.","Verify field names and nesting in the HttpRule variable/selector expression."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}