kotlinx.serialization
kotlinx.serialization copied to clipboard
Protobuf - `sintXX`, `fixedXX` and `sfixedXX` array can't be serialized / deserialized
Describe the bug
Types repeated fixed32, repeated fixed64, repeated sfixed32 and repeated sfixed64 that are packed/unpacked can't be serialized / deserialized.
Types repeated sint32 and repeated sint64 is deserialized incorrectly.
To Reproduce
@ProtoNumber(79) @ProtoPacked val packedSint32: List<Int> = emptyList(),
@ProtoNumber(80) @ProtoPacked val packedSint64: List<Long> = emptyList(),
@ProtoNumber(81) @ProtoPacked val packedFixed32: List<Int> = emptyList(),
@ProtoNumber(82) @ProtoPacked val packedFixed64: List<Long> = emptyList(),
@ProtoNumber(83) @ProtoPacked val packedSfixed32: List<Int> = emptyList(),
@ProtoNumber(84) @ProtoPacked val packedSfixed64: List<Long> = emptyList(),
Results in
While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.
Expected behavior
Should serialize and deserialize correctly.
Environment
- Kotlin version: 1.9.0
- Library version: 1.6.1
- Kotlin platforms: All