rust-protobuf icon indicating copy to clipboard operation
rust-protobuf copied to clipboard

Support Any in text_format.

Open semtexzv opened this issue 2 years ago • 1 comments

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.

semtexzv avatar Jun 03 '22 20:06 semtexzv

I don't have time to work on it, but PR is welcome.

stepancheg avatar Jun 06 '22 00:06 stepancheg