Tianjin Gu
Tianjin Gu

Reputation: 784

How to write text format when proto including google::protobuf::Any

My proto is something like:

message PlatformConfig {
  google.protobuf.Any source_adapter_config = 1;
};

and I want to set proto:

message SessionBundleSourceAdapterConfig {
  SessionBundleConfig config = 1;
}

into source_adapter_config, How to write the this TextFormat of protobuf.

Upvotes: 1

Views: 587

Answers (1)

Tianjin Gu
Tianjin Gu

Reputation: 784

Finally, I found that Any type need a type_url to specify type, for example:

platform_configs {
    key: "tensorflow"
    value {
        source_adapter_config {
            type_url:"type.googleapis.com/tensorflow.serving.SavedModelBundleSourceAdapterConfig"
            value: "..."
        }
    }
}

Upvotes: 1

Related Questions