I would like to avoid that my REST POST Service (JAX-RS in Spring) returns 400 - Bad Request if I call that service with new fields that it is not able to unmarshal.
Let's do an example:
I have this input request java class:
public class PosizioneDto implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private Double controvalore;
private Double quantita;
private Double prezzo;
private ContrattoDto contratto;
private String progressivoMiFid;
private String codiceProdotto;
private String ageC;
private String prodCPadreMifid;
private String prodCFiglio1Mifid;
private String prodCFiglio2Mifid;
private String tipProd;
}
if in the input JSON request there were another field (e.g. "_newProperty") I would like that parser wouldn't go in error, but simply wouldn't unmarshal that property.
Is this possible to do? Should I use some ExceptionMapper?