diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index d17480ee0290..e5fecbb684df 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -1687,13 +1687,12 @@ private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { */ private void addSchemaToIncludedSchemaList(List includedSchemas, Schema schema) { - // if the schema is in the list, then throw an exception. - // this should never happen + // if the schema is in the list, issue a warning if(includedSchemas.contains(schema)) { - throw new RuntimeException("Attempted to add a schema to the includedSchemas list twice"); + LOGGER.warn("Attempted to add a schema to the includedSchemas list twice"); + } else { + includedSchemas.add(schema); } - - includedSchemas.add(schema); } /***