0

根据官方 Nswag命令行文档,可以通过 NPM 控制台包使用 Nswag(然后使用 生成 C# 客户端openapi2cscontroller):

要使用命令行工具 nswag.exe (.NET 4.6+) / dotnet-nswag.dll (.NET Core),请选择以下方法之一:

  • NSwag NPM 模块:.NET 4.6+ 和 .NET Core 命令行工具的绑定(取决于安装的框架/OS 平台)

  • ...

可悲的是,除了链接之外,没有关于这件事的进一步文档。我已经安装了文档中链接的包(使用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.
4

1 回答 1

1

您可以将 nswag 安装为全局:

npm i -g nswag

或使用本地包

node_modules\.bin\nswag
于 2019-09-30T11:29:40.307 回答