I am converting json to pojo
{
"Response": [{
"Status": {
"StatusCode": {
"Value": "urn:oasis:names:tc:xacml:1.0:status:ok"
}
},
"Decision": "NotApplicable"
}]
}
public class PdpResponse {
@JSONField(name ="Response")
public Response response;
public static class Response {
public List<InnerObject> innerObjects;
}
public static class InnerObject {
@JSONField(name = "Status")
public Status status;
@JSONField(name = "Decision")
public String decision;
}
public static class Status {
@JSONField(name = "StatusCode")
public StatusCode statusCode;
}
public static class StatusCode {
@JSONField(name = "Value")
public String value;
}
@JsonIgnore
public String retrieveDecision(){
return this.response.innerObjects.get(0).decision;
}
}
But getting parsing exception.
error is:syntax error, expect {, actual error, pos 0 cause:null
2条答案
按热度按时间ou6hu8tu1#
https://github.com/alibaba/fastjson/blob/0f622019e8f9666d0b8263b05e736abe3792a3ba/src/test/java/com/alibaba/json/bvt/issue_1000/Issue1079.java
i tested it, it's ok
pbpqsu0x2#
@jainh try adding getter and setters in all of your classes which need to be parsed