Oli*_*ley 5 java android json annotations jackson
当我尝试将Json解析为Java pojo对象时,我收到此异常.对象图有几个对象.
org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "id" (Class Criteria), not marked as ignorable
Run Code Online (Sandbox Code Playgroud)
我想看看,在这种情况下会出现这种异常,问题可能出在对象图中?
我在我的android项目中这样做我在这里没有使用注释我不知道如何将此字段添加为可忽略的.
fge*_*fge 15
你没有显示任何代码,所以......
无论如何,尝试将此注释添加到您反序列化的类:
@JsonIgnoreProperties(ignoreUnknown=true)
Run Code Online (Sandbox Code Playgroud)