I have a simple POJO:
public class ADate {
private Integer day;
private Integer month;
private Integer year;
... // getters/setters/constructor
}
The following JSON Document gets deserialized correctly into ADate
:
{
"day":"10",
"month":"2",
"year":"1972"
}
Jackson converts the String into Integer automatically.
Is there a way to avoid this automatic conversion and have Jackson to fail if the Integer values are defined as String.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…