Deserialize empty protobuf list on iOS
See original GitHub issueI have the following data class:
@Serializable
data class Test (
@Optional @SerialId(1) var events: List<Event> = emptyList(),
@Optional @SerialId(2) var games: List<Game> = emptyList()
)
Protobuf deserialization (proto3) works correctly on Android and iOS if both values are not empty. If at least one list property is empty (empty list), the deserialization fails on iOS with error: Unexpected EOF
.
If empty property is commented out of data class, deserialization works on iOS as well.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Language Guide (proto3) | Protocol Buffers - Google Developers
The default value for repeated fields is empty (generally an empty list in ... this is represented when the message is deserialized is...
Read more >Protobuf-net deserializes empty collection to null when the ...
I would argue null should never be used and having an empty list instead should be the default value; at the very least...
Read more >Introduction to Protocol Buffers on iOS - RayWenderlich.com
Integrate the List of Speakers. With the My Badge tab done, it's time to turn your attention to the currently blank Speakers tab....
Read more >Protobuf-net: the unofficial manual - CodeProject
NET library for serialization based on Google's Protocol Buffers. ... The list data type is not recorded, and during deserialization it ...
Read more >MessagePack: It's like JSON. but fast and small.
Serialize /Deserialize for OCaml types (with meta_conv) ... Serialize.serialize_string (msgpack_of_t { int = 42; ... lib/core. List your implementation here!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/Kotlin/kotlinx-io/pull/36 will fix this
You are correct! I managed to make the response shorter and data is indeed handled correctly on iOS as well.