Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public AbstractCSharpCodegen() {
// set "client" as a reserved word to avoid conflicts with IO.Swagger.Client
// this is a workaround and can be removed if c# api client is updated to use
// fully qualified name
"Client", "client", "parameter",
"Client", "client", "parameter", "File",
// local variable names in API methods (endpoints)
"localVarPath", "localVarPathParams", "localVarQueryParams", "localVarHeaderParams",
"localVarFormParams", "localVarFileParams", "localVarStatusCode", "localVarResponse",
Expand Down Expand Up @@ -903,6 +903,14 @@ public void setInterfacePrefix(final String interfacePrefix) {
this.interfacePrefix = interfacePrefix;
}

public CodegenModel fromModel(String name, Schema schema, Map<String, Schema> allDefinitions) {
final CodegenModel codegenModel = super.fromModel(name, schema, allDefinitions);
if (typeMapping.containsKey(name.toLowerCase()) && isReservedWord(name.toLowerCase())) {
typeMapping.remove(name.toLowerCase());
}
return codegenModel;
}

@Override
public String toEnumValue(String value, String datatype) {
// C# only supports enums as literals for int, int?, long, long?, byte, and byte?. All else must be treated as strings.
Expand Down