I have a project that needs a strict json policy.
Example:
public class Foo {
private boolean test;
... setters/getters ...
}
Following json should work:
{
test: true
}
And following should fail (throw exception):
{
test: 1
}
same for:
{
test: "1"
}
Basically I want the deserialization to fail if someone provides something different than true
or false
. Unfortunately jackson treats 1
as true and 0
as false
. I couldn't find a deserialization feature that disables that strange behavior.