Add option use-json-names to allow using json_name globally #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withoption (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.