RicoSuter/NSwag

How to use NSwagStudio and output parameter via command line?

Open

#1,567 建立於 2018年8月30日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)C# (6,291 star) (1,189 fork)batch import
help wantedtype: enhancement

描述

Hi,

I'm using NSwagStudio for generating a .nswag file (I prefer to configure all the settings vía UI, except output for the generator).

Later I would like to use nswag.exe run <my_nswag_file>, but with the parameter output (like say the documentation https://github.com/RSuter/NSwag/wiki/CommandLine#document-variables), something similar to this:

nswag run MySwagger.nswag /output:"..\Api.Client\MyClient.cs"

I have tried with relative and absolute path and does not work (file is not generated) Furthermore, If I open the .nswag file with NSwagStudio, it's seems not respect the output property.

image

My .nswag file has the following content:

"defaultVariables": "Ouput=C:\Users\Sergio\Documents\Visual Studio 2017\Projects\Api\Api.Client\NSwagStudio.cs", -> the default path to the output, ready for invoke nswag run <my_nswag_file> without parameters

and later in this same document...

"swaggerToCSharpClient": { ... "output": "$(Output)" } -> ready for invoke without parameters but also with parameter output -> nswag run MySwagger.nswag /output:..\Api.Client\NSwagStudio.cs

do i missing something?

Thanks a lot of for your great toolchaing :)

貢獻者指南