// this function will generate an api dictionary with apiName/versionsetName (if exist one) as key, list of apiNames as value public static async Task <Dictionary <string, List <string> > > GetAllAPIsDictionary(string sourceApim, string resourceGroup, FileWriter fileWriter) { APIExtractor apiExtractor = new APIExtractor(fileWriter); // pull all apis from service string apis = await apiExtractor.GetAPIsAsync(sourceApim, resourceGroup); JObject oApi = JObject.Parse(apis); // Generate folders based on all apiversionset var apiDictionary = new Dictionary <string, List <string> >(); for (int i = 0; i < ((JContainer)oApi["value"]).Count; i++) { string apiDisplayName = ((JValue)oApi["value"][i]["properties"]["displayName"]).Value.ToString(); if (!apiDictionary.ContainsKey(apiDisplayName)) { List <string> apiVersionSet = new List <string>(); apiVersionSet.Add(((JValue)oApi["value"][i]["name"]).Value.ToString()); apiDictionary[apiDisplayName] = apiVersionSet; } else { apiDictionary[apiDisplayName].Add(((JValue)oApi["value"][i]["name"]).Value.ToString()); } } return(apiDictionary); }