gRPC 属性 命令不匹配协议?

gRPC property order not matching proto?

我开始使用 gRPC,我的原型看起来像:

message Customer {
    int64 customerId = 1;
    string firstName = 2;
    string lastName = 3;
    repeated string roles = 4; 
}

但 BloomRPC 显示为:

{
  "roles": [
    "User",
    "Admin"
  ],
  "customerId": "100000",
  "firstName": "Bob",
  "lastName": "Jenkins"
}

角色不应该放在最后吗?

字段的顺序对消息的序列化方式没有影响。查看 this and this 了解更多信息。