You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: The proto3-json-serializer is not serializing repeated fields in arrays properly. When attempting to serialize a message with repeated fields, the resulting JSON output is missing the array data.
A clear and concise description of what the bug is, and what you expected to happen.
Bug Description: The proto3-json-serializer is not properly serializing repeated fields in arrays. When attempting to serialize a message with repeated fields, the resulting JSON output is missing the array data.
Expected Behavior: The serialized JSON should include the articleHierarchies array with its elements, as specified in the JsonPayload.
Additional Information: Please investigate why the repeated fields in arrays are not being serialized correctly and provide a fix or workaround.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
After some investigation, I found that the articleHierarchies field is case-sensitive. Using articleHierarchies (lowercase 'a') resulted in an empty object {}, while ArticleHierarchies (uppercase 'A') worked as expected. It appears the library isn't handling case sensitivity for this field correctly.
sofisl
added
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
size: m
Pull request size is medium.
labels
Feb 12, 2025
Please make sure you have searched for information in the following guides.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
N/A
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
proto3-json-serializer version: 2.0.2
Node.js version: v20.13.1
protobufjs version: "^7.4.0"
Operating system: Windows
Description: The proto3-json-serializer is not serializing repeated fields in arrays properly. When attempting to serialize a message with repeated fields, the resulting JSON output is missing the array data.
1. Use the following JsonPayload:
2. Serialize the message using the provided logic:
3. Observe the logs after serialization:
4. Expecting the logs after serialization:
A clear and concise description of what the bug is, and what you expected to happen.
Bug Description: The proto3-json-serializer is not properly serializing repeated fields in arrays. When attempting to serialize a message with repeated fields, the resulting JSON output is missing the array data.
Expected Behavior: The serialized JSON should include the articleHierarchies array with its elements, as specified in the JsonPayload.
Additional Information: Please investigate why the repeated fields in arrays are not being serialized correctly and provide a fix or workaround.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
The proto3-json-serializer library is designed to serialize and deserialize protobuf.js objects according to the proto3 JSON specification. According to the documentation (https://cloud.google.com/nodejs/docs/reference/proto3-json-serializer/latest/overview), the library should handle repeated fields in arrays correctly.
Please find the example proto definitions in the comments section below.
The text was updated successfully, but these errors were encountered: