Open rolandpop opened 4 years ago
The default class name is “{controllerName}Client” but this only works with operationIds in the form “{controllerName}_{operationName}” which is the default for NSwag generated specs (this way each controller generates one client and operation/method names are preserved).
In your case you’re “hardcoding” the client names and thus you need a SingleClient* generation mode.
When using Visual Studio and not setting the className, Visual Studio currently sets a hardcoded non-template one, which does not play nice with the default MulipleClient OperationGenerationMode, see https://developercommunity.visualstudio.com/t/OpenApiReference-default-className-break/10639639
While generating a C# client for pipedrive I've encountered the following problem:
The C# client generator created multiple clients and interfaces which caused buid errors. The Yaml : https://developers.pipedrive.com/docs/api/v1/pipedrive-api.yaml
I run the generator with the following arguments (in VS project file):
The result of building the project generated 3 "PipedriveClient"s two of which handle 1 operation each:
and the other:
the rest of the operations are handled in the 3rd client...
I managed to force the generator to create only one client class with the following setting:
OperationGenerationMode:SingleClientFromOperationId
Would be nice to know what happened and why it generated 3 clients.