Proven workaround created:

Solved days of manual rework, but would still appreciate an upgrade to the 
online generator, if time permits.
Hope this helps some other poor schlub who cannot DL maven dependencies at 
work.

Performed a post online generator transform using regex against the Swagger 
API classes, based on PR 6119 
<https://github.com/swagger-api/swagger-codegen/pull/6199> lines 206 and 
234 of the C# api.mustache found here:
https://github.com/swagger-api/swagger-codegen/blob/82835db6701c41b7888c6e13d718c9936358b9f5/modules/swagger-codegen/src/main/resources/csharp/api.mustache





Powershell regex transform as follows:


$targetfiles = gci $sourcedirectory;

foreach ($targetfile in $targetfiles)
{

$filecontent = gc $Targetfile.fullname;

$result = @();
$resultII = @();

$qparamcall = [regex] 
'(?mnxis)(?:\s*)(?<blops>(?:if\s\()(?<basename>\w+)(?:\s\!\=\snull\)\slocalVarQueryParams\.))(?<operation>Add(?:\(\")(\k<basename>|\w+)(?:\"\,\sConfiguration\.ApiClient\.ParameterToString\(\k<basename>)\)\))';

foreach ($line in $filecontent)
{
$result += $qparamcall.Replace($line, 
'${blops}AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("multi", 
"${basename}", ${basename}));');
};



$qparamdef = [regex] 
'(?mnxis)(?<spa>\s*)(?<decl>var\slocalVarQueryParams\s=\snew\sDictionary<String,\sString>\(\))';

foreach ($line in $result)
{
$resultII += $qparamdef.Replace($line, '${spa}var localVarQueryParams = new 
List<KeyValuePair<String, String>>();');
};


$resultII | Out-File (".\output\API\{0}" -f $targetfile.name) -Force;

};





-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to