diff --git a/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/SchemaGenerator.scala b/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/SchemaGenerator.scala index 1ce9d39dda..cf9b2582ac 100644 --- a/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/SchemaGenerator.scala +++ b/openapi-codegen/core/src/main/scala/sttp/tapir/codegen/SchemaGenerator.scala @@ -148,7 +148,7 @@ object SchemaGenerator { // Select next candidate. Order lexicographically for stable output val next = initialSet.minBy(_._1) recurse(next) - res += nextRing.sortBy(_._1) + res += nextRing.distinct.sortBy(_._1) } res.toSeq }