What version of protobuf and what language are you using?
Version: main/v3.6.0/v3.5.0 etc. (NOTE: please try updating to the latest version of protoc/runtime possible beforehand to attempt to resolve your problem)
Version: 3.32.1 from NuGet
Language: C++/Java/Python/C#/Ruby/PHP/Objective-C/Javascript
Language: C#
What operating system (Linux, Windows, ...) and version?
OS: Windows 11
What runtime / compiler are you using (e.g., python version or gcc version)
Runtime: .Net 9
What did you do?
Steps to reproduce the behavior:
- Create a protobuf message.
- Instantiate an object of the generated class and assign values to its properties.
- Use either Newtonsoft.Json or System.Text.Json to serialize the object to a JSON string.
- Use the Protobuf JsonParser to parse the JSON string from step 3.
What did you expect to see
The JsonParser should be able to parse the json string for it's a standard way of json deserialization.
What did you see instead?
Unknow filed exception was thrown.
While examining this related issue (#11987), I observed that CreateJsonFieldMap populates the map with both field.Name and field.JsonName. It seems reasonable that field.PropertyName should also be added after field.Name.