Demo:映射 protobuf message 和引用
Protobuf 文件很紧凑,但 message 引用和 repeated 字段变成类图后更容易检查。
- 分开展示普通字段、enum 字段和 repeated 关系。
- 跨 service 的 schema 保留 package 名。
- 用图 review API 契约,不要只靠图判断二进制兼容。
message Order {
string id = 1;
repeated OrderItem items = 2;
OrderStatus status = 3;
}
message OrderItem { string sku = 1; int32 qty = 2; }