-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Hi all!
I've got an issue where I've got some proto that looks like this:
message ObjectReference {
string object_type = 1;
string object_id = 2;
}I want to define a decoder on this object that moves it to a map so that I can do decoding on the object_id if the object_type matches a condition. The docs show how you might define an encoder/decoder pair where the non-proto side is a scalar value, but it isn't clear to me what to do if it's a map.
Do I define a separate mapper so that I can return a proto-map within the encoder? Does it work to define a decoder in terms of the mapper it's being defined on? Is there another better approach that I'm not thinking of? I'd be happy to contribute the answer to the readme.
EDIT:
I suppose one answer is that this is an inappropriate place to do this sort of transformation, and it'd be better to do it on the clojure constructs that we're moving into proto before it hits the mapper.