Skip to content

Commit 84b3ef5

Browse files
author
Olivier Leonard
committed
Refactor : use getNullableSchemaType in getTypeDeclaration
- also, remove the last GENERICHOST reference remaining
1 parent e9590cd commit 84b3ef5

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import java.util.regex.Pattern;
4545
import java.util.stream.Collectors;
4646

47-
import static org.openapitools.codegen.languages.CSharpClientCodegen.GENERICHOST;
4847
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
4948
import static org.openapitools.codegen.utils.StringUtils.camelize;
5049
import static org.openapitools.codegen.utils.StringUtils.underscore;
@@ -1466,12 +1465,7 @@ public String getTypeDeclaration(Schema p) {
14661465
} else if (ModelUtils.isMapSchema(p)) {
14671466
// Should we also support maps of maps?
14681467
Schema<?> inner = ModelUtils.getAdditionalProperties(p);
1469-
String typeDeclaration = getTypeDeclaration(inner);
1470-
if (!GENERICHOST.equals(getLibrary())) {
1471-
if (ModelUtils.isNullable(inner) && (this.nullReferenceTypesFlag || ModelUtils.isEnumSchema(inner) || getValueTypes().contains(typeDeclaration)) && !typeDeclaration.endsWith("?")) {
1472-
typeDeclaration += "?";
1473-
}
1474-
}
1468+
String typeDeclaration = getNullableSchemaType(inner);
14751469
return getSchemaType(p) + "<string, " + typeDeclaration + ">";
14761470
}
14771471
return super.getTypeDeclaration(p);

0 commit comments

Comments
 (0)