Skip to content

Commit b2ca2f7

Browse files
committed
Solve issue with missing import for array model
1 parent a7dbe80 commit b2ca2f7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
423423
CodegenProperty modelProperty = fromProperty("value", modelSchema);
424424

425425
if (cm.isEnum || cm.isAlias) {
426-
if (!modelProperty.isEnum && !modelProperty.hasValidation) {
426+
if (!modelProperty.isEnum && !modelProperty.hasValidation && !cm.isArrayModel) {
427427
// remove these models because they are aliases and do not have any enums or validations
428428
modelSchemasToRemove.put(cm.name, modelSchema);
429429
}
@@ -833,7 +833,7 @@ public CodegenModel fromModel(String name, Schema schema) {
833833
if (modelProperty.isEnum == true || modelProperty.hasValidation == true || result.isArrayModel) {
834834
// these models are non-object models with enums and/or validations
835835
// add a single property to the model so we can have a way to access validations
836-
result.isAlias = !result.isArrayModel;
836+
result.isAlias = true;
837837
modelProperty.required = true;
838838
List<CodegenProperty> theProperties = Arrays.asList(modelProperty);
839839
result.setAllVars(theProperties);

0 commit comments

Comments
 (0)