From bbf463f7275b69053345630c61444b909d6e345d Mon Sep 17 00:00:00 2001 From: fbl100 Date: Wed, 3 Aug 2022 11:18:03 -0400 Subject: [PATCH] Issue 13043: converted an exception to a warning for doubly adding schemas to the includedSchemas list (#13070) --- .../languages/PythonExperimentalClientCodegen.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); } /***