We are using NSwag to generate web clients.
We have some custom generators for TypeName and OperationName.
Currently we use the NSwag class library and have custom code written to call in a console application.
Here is our CSharpClientGeneratorSettings. As you can see we have a custom class for TypeNameGenerator and OperationNameGenerator.
var cSharpClientGeneratorSettings = new CSharpClientGeneratorSettings
{
ClassName = "{controller}Client",
CSharpGeneratorSettings =
{
Namespace = this._clientNamespace,
ClassStyle = CSharpClassStyle.Inpc,
DateTimeType = "System.DateTime",
DateType = "System.DataTime",
TypeNameGenerator = new CustomTypeNameGenerator(),
JsonLibrary = CSharpJsonLibrary.SystemTextJson
},
GenerateClientInterfaces = true,
GenerateClientClasses = true,
OperationNameGenerator = new TClientGenerator(),
ExceptionClass = "YadaYada.Library.Client.SwaggerException",
InjectHttpClient = true,
SerializeTypeInformation = true,
DisposeHttpClient = true,
WrapDtoExceptions = false,
GenerateOptionalParameters = true,
ExposeJsonSerializerSettings = false,
ParameterArrayType = "System.Collections.Generic.IList",
ResponseArrayType = "System.Collections.Generic.IList",
GenerateExceptionClasses = false,
UseBaseUrl = false,
GenerateDtoTypes = false,
AdditionalNamespaceUsages = this._additionalNamespaces
};
I would like to run this code generation as an MSBuild task without have to build and deploy our console application. Is there any way to 'inject' our custom name operators into the command line version of NSwag? (nswag.exe)?