Skip to content

Commit bfbf615

Browse files
committed
remove redundant type overrides
1 parent 8b9560e commit bfbf615

4 files changed

Lines changed: 2 additions & 17 deletions

File tree

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ public AbstractPythonConnexionServerCodegen(String templateDirectory, boolean fi
9999
simpleModule.addSerializer(Boolean.class, new PythonBooleanSerializer());
100100
MAPPER.registerModule(simpleModule);
101101

102-
// TODO may remove these later to default to the setting in abstract python base class instead
103-
languageSpecificPrimitives.add("list");
104-
languageSpecificPrimitives.add("dict");
105-
typeMapping.put("array", "list");
106-
typeMapping.put("map", "dict");
107-
108102
// set the output folder here
109103
outputFolder = "generated-code" + File.separatorChar + "connexion";
110104

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ public PythonClientCodegen() {
9595
// at the moment
9696
importMapping.clear();
9797

98-
// override type mapping in abstract python codegen
99-
typeMapping.put("array", "list");
100-
typeMapping.put("set", "list");
101-
typeMapping.put("map", "dict");
98+
// extend type mapping in abstract python codegen
10299
typeMapping.put("decimal", "decimal.Decimal");
103100
typeMapping.put("file", "bytearray");
104101
typeMapping.put("binary", "bytearray");

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ public PythonFastAPIServerCodegen() {
115115
additionalProperties.put(CodegenConstants.PACKAGE_NAME, DEFAULT_PACKAGE_NAME);
116116
additionalProperties.put(CodegenConstants.FASTAPI_IMPLEMENTATION_PACKAGE, DEFAULT_IMPL_FOLDER);
117117

118-
typeMapping.put("array", "list");
119-
typeMapping.put("map", "dict");
120-
121118
outputFolder = "generated-code" + File.separator + NAME;
122119
modelTemplateFiles.put("model.mustache", ".py");
123120
apiTemplateFiles.put("api.mustache", ".py");

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ public PythonPydanticV1ClientCodegen() {
9090
// at the moment
9191
importMapping.clear();
9292

93-
// override type mapping in abstract python codegen
94-
typeMapping.put("array", "list");
95-
typeMapping.put("set", "list");
96-
typeMapping.put("map", "dict");
93+
// extend type mapping in abstract python codegen
9794
typeMapping.put("decimal", "decimal.Decimal");
9895
typeMapping.put("file", "bytearray");
9996
typeMapping.put("binary", "bytearray");

0 commit comments

Comments
 (0)