0

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

4

1 回答 1

1

在最新的 Genson 版本 1.1 中,如果没有匹配的属性,您现在可以在构建器中选择失败:

new GensonBuilder().failOnMissingProperty(true).create();
于 2014-09-22T16:19:15.270 回答