Open
Description
In #677 a wrapper for google.protobuf.Any was added. I wanted to use this because it would be very convenient when working with protobuf.Any, but it did not work. Here is an example based on the unit test comp_google_protobuf_any.js what I would like to do:
foo = Foo.fromObject({
foo: {
"@type": ".Bar",
bar: "a"
}
});
test.ok(foo.foo instanceof Bar.ctor, "should unwrap wrapped Bar in fromObject");
// Encode and decode again -> foo.foo is not serialized!
var foo2 = Foo.decode(Foo.encode(foo).finish());
obj = foo2.toObject(foo2, { json: true });
// This fails
test.same(obj.foo, { "@type": ".Bar", bar: "a" }, "this does not work at the moment");
Or is there any other way how I can initialize a message that contains a google.protobuf.Any easily?