Jackson: Is there a way to ignore 0/1 on Boolean deserialization?
问题 I have a JSON object with a Boolean property that needs to allow only true or false during the deserialization. Any value different of true and false should throw an exception. How can I do that? e.g.: Valid json: { "id":1, "isValid":true } Invalid json: { "id":1, "isValid":1 } Update I tried what @Michał Ziober proposed and it worked fine. As I'm implementing a Spring application (with Webflux) I just had to configure in a different way. I'm posting here what I did: Create a Configuration