jax ws - Resteasy Jackson POST -
i trying post on webservice using resteasy , jackson json bindings.
my client interface looks
@produces("application/json") @consumes(value = mediatype.application_json) public interface myclientproxy { @post @path("/messages/send") clientresponse<fooresponse> send(@queryparam("foo") foo foo); }
and object foo like:
@jsonignoreproperties(ignoreunknown = true) public class foo implements serializable { @jsonproperty string bar; public string getbar() { return bar; } public void setbar(string bar) { this.bar = bar; } }
but when run test, can see server post looking like:
{ "foo": "com.x.y.foo@1d75249c" }
how come object foo not being serialized json?
i think need default constructor public foo() {}
:
@jsonignoreproperties(ignoreunknown = true) public class foo implements serializable { @jsonproperty string bar; public foo() {} public string getbar() { return bar; } public void setbar(string bar) { this.bar = bar; } }
Comments
Post a Comment