I have a resource with a method like:
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path(\"/add\")
public Response putThi
You need a no-arg constructor and setters, or use @JsonCreator. Easiest thing to do would be just to add the no-arg with setters. Jackson needs the setters when deserializing. For serialization, all that's needed are getters.
EDIT
To keep it immutable, you can use @JsonCreator on the constructor. For example
@JsonCreator
public Thing(@JsonProperty("symbol") String symbol,
@JsonProperty("name") String name) {
this.symbol = symbol;
this.name = name;
}
See more Jackson Annotations: @JsonCreator demystified