onepiece
onepiece

Reputation: 3529

Is it backwards compatible to move protos to another file?

For example if I cut and paste existing proto

message A {
  string b = 1;
}

from /repo/protos/foo.proto to /repo/protos2/foo2.proto

Is this ok to do? I realize .pb.gos will change. I'm trying to organize my protos, foo.proto is getting too big.

Upvotes: 0

Views: 1066

Answers (1)

Rafael Lerm
Rafael Lerm

Reputation: 1400

Yes. What matters are the types and field numbers. As long as that doesn't change, serialization and deserialization will be backwards compatible.

Upvotes: 1

Related Questions