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

Fix #102 #103

Merged
merged 6 commits into from
Jul 13, 2023
Merged

Fix #102 #103

merged 6 commits into from
Jul 13, 2023

Conversation

jhaber
Copy link
Member

@jhaber jhaber commented Jul 13, 2023

Thanks to @rdesgroppes for noticing that #82 causes issues for protos compiled from descriptor sets. The generated code always has json_name populated, which breaks things quite loudly.

This PR attempts to work around the issue by not relying exclusively on the presence of json_name. There's a new heuristic which checks whether the json_name matches the default json name computed from the field name. If so, we assume that it's not an explicit json_name and ignore it.

We could also revisit this behavior in the future if protocolbuffers/protobuf#5587 gets addressed

Rather than trying to compile protos from descriptor sets as part of the build, I just checked in a pre-compiled proto that was configured this way.

@jhaber jhaber merged commit fe1466c into master Jul 13, 2023
2 checks passed
@jhaber jhaber deleted the jh/json-names-test branch July 13, 2023 15:38
@rdesgroppes
Copy link

Thank you so much!

@rdesgroppes
Copy link

I took the liberty to file a minor followup: #105

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

Successfully merging this pull request may close these issues.

2 participants