Closed benrhere closed 8 months ago
dotnet "D:\Path\To\Project\node_modules\nswag\bin/binaries/Net80/dotnet-nswag.dll" run /runtime:Net80 /variables:SwaggerFile=swagger-public.json,DtoProject=Core
should work
or eq.
dotnet "D:\Path\To\Project\node_modules\nswag\bin/binaries/Net80/dotnet-nswag.dll" run nswagConfigurationFile.json /variables:SwaggerFile=swagger-public.json,DtoProject=Core
@krzyhan thank you! Adding the runtime flag solved my issue.
Hi,
I think the jump from 13.20 to 14.0.1 of the npm module may have changed behavior for command line parsing. When I npm install witih nswag 13.20.0, and then I run:
dotnet "D:\Path\To\Project\node_modules\nswag\bin\binaries\Net70\dotnet-nswag.dll" run /variables:SwaggerFile=swagger-public.json,DtoProject=Core
I get:
It has recognized the variables passed in. Next, I'll update my package.json to reference nswag 14.0.1, npm install, and rerun while replacing Net70 witih Net80 below. I now get:
The npm module version is the only thing I'm changing. I was also toying with nuget packages, but I was able to isolate the problem to only the above npm change. If it's relevant, the above repro is while my ASP.NET Core project is on 14.0.1 for NSwag.AspNetCore, NSwag.CodeGeneration.TypeScript, NSwag.Core, and NSwag.MSBuild.
If I remove all variables:
dotnet "D:\Path\To\Project\node_modules\nswag\bin\binaries\Net80\dotnet-nswag.dll" run
I can run successfully even on the newest npm package. It's also respecting the "defaultVariables" even in this case.
Thanks for your guidance!
(Edited to show repro with 14.0.1 and NET80 for clarity - original post showed repro with 14.0.0 and NET70 but same problem repro'd)