These lines of code, https://github.com/swagger-api/swagger-codegen/blob/v2.1.6/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java#L142-L146 , sets the values of:
This means they have the same values for every CSharp client generated.
We want to be able to set these values via additional-properties on command line generation.
https://github.com/swagger-api/swagger-codegen/tree/v2.1.6
https://github.com/swagger-api/swagger-codegen/issues/1797
For each of the following:
Add a check to see if a value has been specified in the additional-properties, e.g.:
if (!additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
additionalProperties.put("packageTitle", this.packageTitle);
}
@RowanJKWalker Thanks for providing this feedback.
One clarification:
CodegenConstants.PACKAGE_NAME is the namespace while packageTitle is the assembly's title which would display in DLL properties, these aren't the same thing. From AssemblyTitleAttribute Class:
Specifies a description for an assembly.
While there's no steadfast rule that these _can't_ be the same, it would be restrictive to make them the same.
This should be a relatively simply fix, so I'll start on it today.
@RowanJKWalker actually, since this is a pretty simple fix, would you like to provide a PR?
My recommendation is to add the constants to CodegenConstants, then add the properties and their defaults to AbstractCSharpCodegen and pull/set values in processOpts like others:
// {{packageVersion}}
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) {
setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION));
} else {
additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion);
}
Cool, will do. Thanks!
Here is my Pull Request for this issue
Closing this issue as Pull Request has now been merged into master.
@RowanJKWalker thanks again for the contribution.