rust-protobuf
rust-protobuf copied to clipboard
Support Any in text_format.
Given the proto:
syntax = "proto3";
package api;
import "google/protobuf/any.proto";
message Meta {
}
message Object {
google.protobuf.Any object = 1;
}
message Service {
Meta meta = 1;
string descr = 2;
}
I would like to work with textprotos in following format:
# proto-file: api.proto
# proto-message: Object
object {
[type.googleapis.com/api.Service] {
meta { }
descr: "Example"
}
}
Current implementation does not support Any notation at all. This notation is outlined in the spec.
Implementation notes
Implementation will probably require introducing a context into the deserialization process. The context will need to contain a registry of known types.
I don't have time to work on it, but PR is welcome.