Support preserving unknown fields in ProtoBuf format
Introducing new annotation @ProtoUnknownFields and built-in type ProtoMessage, to store any fields with proto ids that are undefined in current message class.
In my understanding, both ktx-serialization and protocol buffer are designed in strong typing, all messages used in code should be well defined in kt class or proto message. Therefore I would like to keep ProtoMessage and ProtoField minimun published. Not like JsonObject in json format, users cannot retrieve detailed data from it.
Close #2655
@sandwwraith Hi, please take a look here?
@xiaozhikang0916 Sure, when I'll have time
@pdvrieze Actually I don't want to decode the protobuf wire data into a tree-structure type like what JsonObject do, neither provide retreiving method of the content.
The raw content in protobuf wire data is quite ambiguous that, you can even not possible to tell whether a VARINT 1 is 1 or -1 or true, or tell a LEN field is string or sub-message. The only way to parse wire data content correctly and explictly is to parse with message definition, or with a concrete type in kotlin.
Base on it, ProtoMessage here is not designed for retrieving content from undefined fields, but for holding it only.
Any progress about it? We have plan on upgrading Kotlin and serialization runtime version, and it would be great if we can have this functionality in near future.