Hi. I'm trying to serialize a message into JSON including its extension fields. Can this be achieved using scalapb.json4s?
The messages are defined as:
// This is defined in 1 proto file
message User {
required string name = 1;
extensions 100 to 999;
}
// This is defined in a another proto file
message UserExtension {
extend User {
optional string uuid = 100;
}
}
And the code is:
private val user = User(name = "lior").withExtension(UserExtension.uuid)(Some(UUID.randomUUID().toString))
println(new Printer().print(user))
I would expect this to print both the name and uuid fields, but the output is {"name":"lior"}.
Also, a followup question - assuming printing the extensions field is possible, is it possible to change the keys in the JSON to reflect that extensions fields are not part of the original class? For example, by adding a prefix, or putting them all inside a sub JSON?
Thanks.