Open amanvishnani opened 6 years ago
Thank you for reporting this.
Protobuf v2 does not really have a Map
type natively as far as I recall, and has to be emulated by something like an array of objects with 2 properties (key and value). So the challenge is that of choosing a standard representation for such structure; I am not sure if spec suggests anything.
Similar problem probably affects the reverse case too, of a map-like structure to bind to Java Map
values.
I can find Map definition on the official doc webpage. https://developers.google.com/protocol-buffers/docs/proto#maps
Ah. Ok. Well then that should be quite doable. Thank you for pointing that out -- I think (although can not point out) that this was added after module was originally written, so I just recall that there is no native structure. Either way, yes, handling should be added.
I'd also love to have this feature. Is there any ETA?
I don't think anyone is working on this. Typically any work would be accompanied by updates here.
This seems like a fairly important feature in order for this to be useable. Any updates on this being implemented?
Edit: Also, are there any workarounds? I was thinking about providing a StdSerializer/Deserializer, but I'm fairly certain that that wouldn't help with the generation of the schema. Is there a way for me to tell it to consider a Map<String, String> to be a List<Pair<String, String>> for the purpose of generating the schema (and then I can go ahead and implement the serialization/deserialization myself).
Any updates on this?
looks pretty hard to add arbitrary map support, consider well known json type in protobuf is not well supported.
Later spec version (for Protobuf 2.x) does seem to indicate guidance on how to handle Map types, so this should be doable. I just wish I had time to work on this.
I am trying to get protobuf schema of the following POJO object.
The exception is thrown on executing the following LOC.
I was hoping that since Maps are supported in Protocol Buffers then it should have been implemented in this library. I am using the following version.