diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java index 5fc6023360f9..52a203e3c974 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java @@ -881,7 +881,7 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { typingImports.add("Union"); Set discriminator = model.getDiscriminator().getMappedModels(); for (CodegenDiscriminator.MappedModel mappedModel : discriminator) { - postponedModelImports.add(mappedModel.getMappingName()); + postponedModelImports.add(mappedModel.getModelName()); } } }