I am trying to convert string into json using jackson.
I have used ObjectMapper().readValue()
and deserialize into a DragDropJsonDto class
qList.getHeader() is like this "<p>{
"RC" : ["N" , "Raj" , "USA"],
"LC" : [
"Enter Country Name :" ,
"Enter State Name :",
"Enter City Name :" ]
}</p>"
public class DragDropJsonDto {
private List<String> RC;
private List<String> LC;
public List<String> getRC() {
return RC;
}
public void setRC(List<String> RC) {
this.RC = RC;
}
public List<String> getLC() {
return LC;
}
public void setLC(List<String> LC) {
this.LC = LC;
}
}
DragDropJsonDto dragDropJson = new ObjectMapper().readValue(qList.getHeader(), DragDropJsonDto.class);
I am not able to convert into json exception arises
Error Unrecognized field "RC" (class com.visataar.lt.web.dto.DragDropJsonDto), not marked as ignorable (2 known properties: "rc", "lc"])