forked from loafle/openapi-generator-original
[csharp] Fix interfacePrefix sensitivity + default (#4561)
After merging the fix with another C# change, noticed case sensitivity issue for the true/false checks. Also noticed my original implementation wasn't setting the default I- prefix as intended. This commit resolves those three issues.
This commit is contained in:
parent
2d8715f42c
commit
23c5376ed6
@ -259,15 +259,16 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.INTERFACE_PREFIX)) {
|
||||
String useInterfacePrefix = additionalProperties.get(CodegenConstants.INTERFACE_PREFIX).toString();
|
||||
if("false".equals(useInterfacePrefix)) {
|
||||
if("false".equals(useInterfacePrefix.toLowerCase())) {
|
||||
setInterfacePrefix("");
|
||||
} else if(!"true".equals(useInterfacePrefix)) {
|
||||
} else if(!"true".equals(useInterfacePrefix.toLowerCase())) {
|
||||
// NOTE: if user passes "true" explicitly, we use the default I- prefix. The other supported case here is a custom prefix.
|
||||
setInterfacePrefix(sanitizeName(useInterfacePrefix));
|
||||
}
|
||||
|
||||
additionalProperties.put(CodegenConstants.INTERFACE_PREFIX, interfacePrefix);
|
||||
}
|
||||
|
||||
// This either updates additionalProperties with the above fixes, or sets the default if the option was not specified.
|
||||
additionalProperties.put(CodegenConstants.INTERFACE_PREFIX, interfacePrefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user