[英]Use Nswag Console (from NPM package) in order to generate C# client
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
):根据官方 Nswag命令行文档,可以通过 NPM 控制台 package 使用 Nswag(然后使用
openapi2cscontroller
生成 C# 客户端)
To use the command line tool nswag.exe (.NET 4.6+) / dotnet-nswag.dll (.NET Core), choose one of the following methods:
要使用命令行工具 nswag.exe (.NET 4.6+) / dotnet-nswag.dll (.NET Core),请选择以下方法之一:
NSwag NPM Module: Bindings for the .NET 4.6+ and .NET Core command line tools (depending on installed framework/OS platform)
NSwag NPM 模块:.NET 4.6+ 和 .NET 核心命令行工具的绑定(取决于安装的框架/操作系统平台)
...
...
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:我已经安装了文档中链接的 package (使用
npm install nswag --save-dev
),但是它要么损坏,要么需要进一步的未记录步骤:
> nswag new
> nswag : The term 'nswag' is not recognized as the name of a cmdlet, function, script file, or operable program.
You can install nswag as global:您可以将 nswag 安装为全局:
npm i -g nswag
or use local package或使用本地 package
node_modules\.bin\nswag
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.