Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
witemple-msft opened this issue Jun 14, 2022 · 1 comment · Fixed by #636
Closed

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

witemple-msft opened this issue Jun 14, 2022 · 1 comment · Fixed by #636
Assignees
Milestone

Comments

@witemple-msft
Copy link
Member

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);
}
@ghost ghost added the Needs Triage label Jun 14, 2022
@witemple-msft
Copy link
Member Author

gRPC priority: 1 (IMO, this is essential)
Estimate: 5
Needs Design - should we emit the required google protobuf library components as part of the CADL spec emit or require customers to provide the google protobuf libraries themselves. Should it be configurable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants