We're migrating a .NET C# class library from .NET Framework 4.6.2 to .NET Standard 2.0. We use the OpenAPI client code generator to generate code from a bunch of API definition files.
Using CodeGen 6.0.1 against OpenAPI 2.0 documents.
The code generator looks fine apart from the fact that it includes parameters named "operationIndex" for every call, eg:
/// <summary>
/// Get a list of lists.
/// </summary>
/// <param name="listType">The type of list to return.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiCollectionOfList</returns>
public ApiCollectionOfList GetLists(string listType, int operationIndex = 0);
I've searched through the OpenAPI doco, and the web generally, but I can't find any reference to this. The OpenAPI definition files don't contain any reference to this parameter. To us, it's just noise in the code we'd like to dispense with.
Does anyone now anything about this and how to suppress it?
UPDATE
Powershell command:
java -jar openapi-generator-cli-6.0.1.jar generate -i "2022-08-17\aaa_Definition Files\List.swagger.json" -g csharp-netcore -o "2022-08-17\List" -c "NetStd2\List.config.json"
CodeGen config (List.config.json):
{
"packageName": "SKYLib.List",
"targetFramework": "netstandard2.0",
"modelPropertyNaming": "PascalCase",
"nonPublicApi": "false",
"useCollection": "false",
"validatable": "false",
"optionalAssemblyInfo": "false",
"optionalEmitDefaultValues": "false",
"optionalMethodArgument": "true",
"optionalProjectFile": "false",
"releaseNote": null
}
Sample definition file
https://developer.sky.blackbaud.com/docs/services/list/export?DocumentFormat=Swagger