RicoSuter/NSwag

How to use NSwagStudio and output parameter via command line?

Open

#1567 opened on Aug 30, 2018

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C# (6,291 stars) (1,189 forks)batch import
help wantedtype: enhancement

Description

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 :)

Contributor guide