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

Add 3rd party rpc protos in order to have access to status and error #563

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

rvegas
Copy link
Contributor

@rvegas rvegas commented Feb 28, 2018

No description provided.

@googlebot
Copy link

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. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers
  • Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
  • The email used to register you as an authorized contributor must also be attached to your GitHub account.

@rvegas
Copy link
Contributor Author

rvegas commented Feb 28, 2018

I signed it!

@googlebot
Copy link

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.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot
Copy link

CLAs look good, thanks!

@rvegas
Copy link
Contributor Author

rvegas commented Mar 6, 2018

Any love from maintainers?

@achew22
Copy link
Collaborator

achew22 commented Mar 7, 2018

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

@rvegas
Copy link
Contributor Author

rvegas commented Mar 28, 2018

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 googleapis proto package entirely, just as it's already done by including the http and the annotations protos.

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.

@achew22 achew22 merged commit b502d2d into grpc-ecosystem:master Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants