Skip to content

Commit d3e23bb

Browse files
committed
Fix some cubic findings
1 parent 4f26f25 commit d3e23bb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,12 +1774,13 @@ protected void ensureInheritanceForDiscriminatorMappings(Schema parent, Schema c
17741774
}
17751775

17761776
/**
1777-
* return true if the child as an allOf referencing the parent scham.
1777+
* return true if the child as an allOf referencing the parent schema.
17781778
*/
17791779
private boolean hasParent(Schema parent, Schema child, String reference, Set<Schema> visitedSchemas) {
1780-
if (child == null) {
1780+
if (child == null || visitedSchemas.contains(child)) {
17811781
return false;
17821782
}
1783+
visitedSchemas.add(child);
17831784
if (child.get$ref() != null && child.get$ref().equals(reference)) {
17841785
return true;
17851786
}

0 commit comments

Comments
 (0)