I generated C# code from a Swagger definition and was wondering if there is a configuration parameter to automatically include using
statements in the generated files. I found this link https://github.com/RicoSuter/NSwag/wiki/NSwag-Configuration-Document with config-parameters but none of these seems to make the trick. To be more clear, my file at the moment looks like this at the top:
I would like the autogenerated file to include using
statements like this:
Any help or tips are very appretiated.
In your NSwag configuration, you can set:
"openApiToCSharpClient": {
...
"additionalNamespaceUsages": [
"RDT.Api.DomainModels"
],
...
"namespace": "RDT.Api.Repository",
...
}
Alternately, NSwagStudio includes an option 'Additional Namespace Usages'.
To keep the settings, you can save your .nswag
file for future use
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.