-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add 3rd party rpc protos in order to have access to status and error #563
Conversation
Thanks for your pull request. t looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
CLAs look good, thanks! |
Any love from maintainers? |
Thanks so much for your contribution! Can you help me understand a little more about this change? Why we should package these inside the grpc-gateway package instead of having clients vendor them in their own projects? Why is this necessary now so many years into the project when it wasn't needed before? It's great to have more minds thinking about these problems so we, together, can trend toward better solutions |
Hey @achew22 thanks for replying and reviewing. The main objective here is to allow for the REST API definition to be able to handle possible error definitions without having to load the whole For example, it would allow you to have this in your protos: // This resource represents a long-running operation that is the result of a
// network API call.
message Operation {
string name = 1;
google.protobuf.Any metadata = 2;
bool done = 3;
// The operation result, which can be either an `error` or a valid `response`.
// If `done` == `false`, neither `error` nor `response` is set.
// If `done` == `true`, exactly one of `error` or `response` is set.
oneof result {
// The error result of the operation in case of failure or cancellation.
google.rpc.Status error = 4;
// The normal response of the operation in case of success.
google.protobuf.Any response = 5;
}
} What do you think? This allows for far better expressed APIs and its common practice in many standards such as JSONAPI to define errors fully. |
No description provided.