This is my JSON
{
"user":{
"self":"https://my.atlassian.net/rest/api/2/user?username=admin",
"name":"admin",
"key":"admin",
"emailAddress":"[email protected]",
"avatarUrls":{
"48x48":"https://my.atlassian.net/secure/useravatar?ownerId=admin&avatarId=10500",
"24x24":"https://my.atlassian.net/secure/useravatar?size=small&ownerId=admin&avatarId=10500",
"16x16":"https://my.atlassian.net/secure/useravatar?size=xsmall&ownerId=admin&avatarId=10500",
"32x32":"https://my.atlassian.net/secure/useravatar?size=medium&ownerId=admin&avatarId=10500"
},
"displayName":"Ratan[Administrator]",
"active":true,
"timeZone":"Asia/Kolkata"
}
}
My fav site for converting into Apex https://www.adminbooster.com/tool/json2apex
Generated apex class.
public class fromJSON{
public cls_user user;
class cls_user {
public String self;
public String name;
public String key;
public String emailAddress;
public cls_avatarUrls avatarUrls;
public String displayName;
public boolean active;
public String timeZone;
}
class cls_avatarUrls {
public String 48x48; // profile picture size
public String 24x24;
public String 16x16;
public String 32x32;
}
public static fromJSON parse(String json){
return (fromJSON) System.JSON.deserialize(json, fromJSON.class);
}
}
Now my problem is below
class cls_avatarUrls {
public String 48x48; // profile picture size
public String 24x24;
public String 16x16;
public String 32x32;
}
If I try to save then receives unexpected token: '48'
I know we can't use integer 48x48 here.
So is there way to solve this issue/problem
Thanks in advance.