Genson not throwing UnrecognizedPropertyException

105 Views Asked by At

I have json POST request with the following {"token":"abcd","m":"n"} where as the java bean holds:

@XmlRootElement
class Token {

    public String token;

}

On using Genson, it is not throwing UnrecognizedPropertyException which otherwise happen if i remove Genson dependency from pom.xml

1

There are 1 best solutions below

0
On BEST ANSWER

In latest Genson release 1.1, you have now an option in the builder to fail if no property matches:

new GensonBuilder().failOnMissingProperty(true).create();