I have a class defined as follows -
public class info {
private final string name;
private final string add;
private final Map<String, Skill> skills;
}
public class Skill {
String subCategory;
String proficiency;
}
JSON as -
{
"name": "abc",
"add": "random",
"skills": {
"java": {
"subCategory": "soft",
"proficiency": "A"
}
"C#": {
"subCategory": "soft",
"proficiency": "B"
}
}
}
How can i convert this json to java object info? I have tried using gson library but running into multiple errors.
The issue is because of map inside a class skills. Not sure how to convert. i looked at example Converting JSON to Java object using Gson but its pretty simple no lists or map inside the class.