Is there any way to find outthat input JSON contains multiple times concrete parameter in Spring REST? For instance if I have controller:
@PostMapping("/")
public void handle(@RequestBody Id id) {
...
}
Where object Id is classic POJO
public class Id {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
And in request json is sent twice parameter id
{
"id" : "value",
"id" : "different value"
}
is possible to find out that id was send twice?
Solution: I add to application.proeprties:
spring.jackson.parser.strict-duplicate-detection=true