@JsonIgnoreProperties (ignoreUnknown = false) does not work with spring 4.2.0 and the upper version of spring. But it works with 4.0.4 and 4.0.1. I use spring 4.2.8 and Jackson dependencies are used
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.3</version>
</dependency>
If I send a json request with invalid fields, it accepts as a valid request. But he has to give a bad request as an answer. For example: if I have a class
public class Student{
private String id;
private String name;
}
If you send a valid matching json request, it should look like
{
"id": "123",
"name": "test"
}
But even if I send a json request with invalid fields as shown below, it still accepts.
{
"id": "123",
"name": "test",
"anyinvalidkey": "test"
}
But he should give a bad request as an answer