Skip to content

Commit

Permalink
Issue 13043: converted an exception to a warning for doubly adding sc…
Browse files Browse the repository at this point in the history
…hemas to the includedSchemas list (#13070)
  • Loading branch information
fbl100 authored Aug 3, 2022
1 parent 4da8176 commit bbf463f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1687,13 +1687,12 @@ private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) {
*/
private void addSchemaToIncludedSchemaList(List<Schema> 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);
}

/***
Expand Down

0 comments on commit bbf463f

Please sign in to comment.