NSwag.MSBuild generate a single C# client class methods without controller name prefix

204 Views Asked by At

I use NSwag.MSBuild to generate the swagger.json file from the .net API controller. Then generate the C# client from the swagger.json file.

In nswag.json, I set "operationGenerationMode": "SingleClientFromOperationId" under openApiToCSharpClient. However, C# client method names are generated with the pattern <controller>_<actionMethod>. I only wanted to generate a single client with <actionMethod> without the prefix <controller>_.

With the NSwag.MSBuild tool:

For webApiToOpenApi generation, is there a setting to generate operationId without the <controller>_ prefix?

Or is there a setting in openApiToCSharpClient to generate methods to ignore <controller>_ prefix?

0

There are 0 best solutions below