Reputation: 3583
According to the official Nswag command line docs it is possible to use Nswag via NPM console package (and subsquently generate C# client using openapi2cscontroller
):
To use the command line tool nswag.exe (.NET 4.6+) / dotnet-nswag.dll (.NET Core), choose one of the following methods:
NSwag NPM Module: Bindings for the .NET 4.6+ and .NET Core command line tools (depending on installed framework/OS platform)
...
Sadly, except for the link there is no further documentation in that matter. I have installed the package linked in the documentation (using npm install nswag --save-dev
), it is however either broken or further undocumented steps are required:
> nswag new
> nswag : The term 'nswag' is not recognized as the name of a cmdlet, function, script file, or operable program.
Upvotes: 0
Views: 7884
Reputation: 912
You can install nswag as global:
npm i -g nswag
or use local package
node_modules\.bin\nswag
Upvotes: 2