Skip to content

[gRPC] Support well-known protobuf library types. #630

Description

@witemple-msft

Google maintains a core protobuf library that has some shared models that are required to support some data types well: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf

For example:

  • Map dateTime fields (only naive with respect to time zone) into google.protobuf.Timestamp.
  • Map null to google.protobuf.NullValue.
  • Map void to google.protobuf.Empty
  • Maybe map unknown models to google.protobuf.Any

google.protobuf must be included somehow in the output directory (e.g. emitted by cadl-grpc alongside the user's packages) and types must be referenced using import declarations with a relative path, e.g.:

import "../../google/protobuf/empty.proto";

package "com.azure.Widgets";

service WidgetService {
  rpc paint (PaintRequest) returns (google.protobuf.Empty);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions