Skip to content

Commit bbf463f

Browse files
authored
Issue 13043: converted an exception to a warning for doubly adding schemas to the includedSchemas list (OpenAPITools#13070)
1 parent 4da8176 commit bbf463f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -1687,13 +1687,12 @@ private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) {
16871687
*/
16881688
private void addSchemaToIncludedSchemaList(List<Schema> includedSchemas, Schema schema) {
16891689

1690-
// if the schema is in the list, then throw an exception.
1691-
// this should never happen
1690+
// if the schema is in the list, issue a warning
16921691
if(includedSchemas.contains(schema)) {
1693-
throw new RuntimeException("Attempted to add a schema to the includedSchemas list twice");
1692+
LOGGER.warn("Attempted to add a schema to the includedSchemas list twice");
1693+
} else {
1694+
includedSchemas.add(schema);
16941695
}
1695-
1696-
includedSchemas.add(schema);
16971696
}
16981697

16991698
/***

0 commit comments

Comments
 (0)