-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
C# JsonParser fails to parse group #16968
Comments
Thanks for reporting this. When you say:
... do you mean that it was parsed successfully in 3.26.0? |
(Logged internally as b/343354710) |
Yes, it worked in 3.26.1. But as far as I know, that relied on the (weird IMO) behavior where "group fields" were reported as "message fields". More specifially, Probably introduced in this change (included in 3.27.0, but not 3.26.1): 450022d#diff-675b90652e1eebe500f6c60eaea34d328f3113d80e17d8375d5f0a01a53aa520R256 This check https://github.com/protocolbuffers/protobuf/blob/main/csharp/src/Google.Protobuf/JsonParser.cs#L333 probably needs to include checking for |
Okay, I'll look when I get a chance. I don't know when I'll be able to get to this though - hopefully in the next couple of weeks. |
I went ahead and created a PR for this |
Thanks for accepting the PR this quick! |
@CommonGuy: It's now been published. |
Fixes protocolbuffers#16968 Closes protocolbuffers#16970 COPYBARA_INTEGRATE_REVIEW=protocolbuffers#16970 from CommonGuy:main b008e18 PiperOrigin-RevId: 638578696
What version of protobuf and what language are you using?
Version: 3.27.0
Language: C#
What operating system (Linux, Windows, ...) and version?
Windows, but doesn't matter
What runtime / compiler are you using (e.g., python version or gcc version)
Doesn't matter
What did you do?
Steps to reproduce the behavior:
What did you expect to see
The JSON should be parsed successfully.
What did you see instead?
This happens at https://github.com/protocolbuffers/protobuf/blob/main/csharp/src/Google.Protobuf/JsonParser.cs#L380, since the code does not handle groups at all. I think this was due to version 3.26.0 having workarounds that reported the field type of a group as "message".
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
Proto2 test message:
Edition 2023 test message:
The text was updated successfully, but these errors were encountered: