Found the issue and there's a bug in the open api specification that ignored the delimiter to use for origins and destinations in method DistanceMatrixAsyncWithHttpInfo() where it was calling this line of code
if (destinations != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("pipe", "destinations", destinations)); // query parameter
if (origins != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("pipe", "origins", origins)); // query parameter
The ParameterToKeyValuePairs() method didn't pass along "pipe" to ParameterToString(). So I had to add the collectionFormat
public IEnumerable<KeyValuePair<string, string>> ParameterToKeyValuePairs(string collectionFormat, string name, object value)
{
var parameters = new List<KeyValuePair<string, string>>();
if (IsCollection(value) && collectionFormat == "multi")
{
var valueCollection = value as IEnumerable;
parameters.AddRange(from object item in valueCollection select new KeyValuePair<string, string>(name, ParameterToString(collectionFormat,item)));
}
else
{
parameters.Add(new KeyValuePair<string, string>(name, ParameterToString(collectionFormat, value)));
}
return parameters;
}
So in the ParameterToString() method needed to add the switch statement
else if (obj is IList)
{
var flattenedString = new StringBuilder();
foreach (var param in (IList)obj)
{
if (flattenedString.Length > 0)
switch (collectionFormat)
{
case "pipe":
flattenedString.Append("|");
break;
default:
flattenedString.Append(",");
break;
};
flattenedString.Append(param);
}
return flattenedString.ToString();
}