I have a Json Object which I created with the online JSON to apex tool. This works a a separate class how can i make this a subclass. I get the error:
Inner types are not allowed to have inner types
How do I refactor this to not have innertypes within innertypes?
Apex
global with sharing class mainclass {
public class SalesProductJSON{
public String ProductCode; //
public String ProductName; //
public cls_SalesProductSections[] SalesProductSections;
class cls_SalesProductSections {
public String SectionCode; //
public String SectionName; //
public cls_SalesProductItems[] SalesProductItems;
}
class cls_SalesProductItems {
public String ItemCode; //
public String ItemName; //
}
public static List<salesProductJSON> parse(String json){
return (List<salesProductJSON>) System.JSON.deserialize(json, List<salesProductJSON>.class);
}
}
}