Is there a way to prevent an exception from being thrown if there are extra
properties in the JSON data sent to a resource? If there are any properties
in the JSON that do not map to the POJO, and exception gets thrown. I want
to just ignore those properties.
@Consumes(MediaType.APPLICATION_JSON)
public Response createItem(ItemDTO dto) {
...
}
public class ItemDTO {
String name;
}
JSON:
{name: "Item 1", junk: "Property not in POJO"}
An exception is thrown because ItemDTO.junk doesn't exist. How can I ignore
extra properties?
Thanks,
Tauren