Skip to content

Commit 25c42e7

Browse files
committed
ignore $ref's for loop detection
1 parent da9ab86 commit 25c42e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/converter/DataTypeConverter.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ class DataTypeConverter(
360360
*/
361361
private fun isLoop(info: SchemaInfo): Boolean {
362362
val found = current.find {
363-
it.getName() == info.getName()
363+
// $ref and non-ref SchemaInfo have the same name.
364+
// We are only interested if we have seen a non-ref!
365+
it.getName() == info.getName() && !it.isRefObject()
364366
}
365367
return found != null
366368
}

0 commit comments

Comments
 (0)