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

protoc-gen-json: options are omitted #16

Closed
srenatus opened this issue Aug 27, 2019 · 3 comments
Closed

protoc-gen-json: options are omitted #16

srenatus opened this issue Aug 27, 2019 · 3 comments

Comments

@srenatus
Copy link

When looking at the protoc-gen-json output of

protoc -I. -Ivendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/ --json_out=$(pwd)/out components/automate-gateway/api/iam/v2beta/policy.proto

run with this file, I see most of what I'd expect to see, but all the options fields a empty. For example,

      "service": [
        {
          "name": "Policies",
          "method": [
            {
              "name": "CreatePolicy",
              "input_type": ".chef.automate.api.iam.v2beta.CreatePolicyReq",
              "output_type": ".chef.automate.api.iam.v2beta.CreatePolicyResp",
              "options": {}
            },

Am I missing something? Is there a way to have the options dumped as well? I do believe all the information should be in the CodeGenerationRequest 🤔

@srenatus
Copy link
Author

Hah it's probably what was noted here:

If you wish to retain e.g. grpc-gateway google.api.http annotations, you'll need to make use of protoc-gen-dump instead of protoc-gen-json.

Sorry for the noise. 😄

@srenatus
Copy link
Author

srenatus commented Sep 3, 2019

At any rate, I'm still curious what an annotation needs to do to be json-encodable... Can you enlighten me? 😃

@keegancsmith
Copy link
Member

^^ cc @slimsag

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

No branches or pull requests

2 participants