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 option use-json-names to allow using json_name globally #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mshibuya
Copy link

I use this project to keeping a proto definition to a BigQuery table. The proto has many nested messages inside.
I use jsonpb.Marshaler to generate json messages which are imported into the BigQuery table. So I tried to use json_name for BigQuery fields as well, but I found that I need to tag every nested messages referenced in the proto with option (gen_bq_schema.bigquery_opts).json_name = true;.
It's kind of error-prone, since the BigQuery schema generation isn't the only usage of the proto, and there's a possibility that anyone creates a new proto without adding json_name = true.
So I wanted to turn it on globally, but I couldn't find an easy way to do so other than adding a global option. Hence this PR.

I'm new to the project. Any suggestions to improve my change will be appreciated.
Thank you for the maintenance effort.

@google-cla
Copy link

google-cla bot commented Apr 23, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

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