Hi all!
I have a question with the OpenAPI documentation and Scala 3 enums that have the same name in a different scope. Let’s say you have two classes like the following:
case class User(name: String, status: User.Status)
object User:
enum Status
case Active, Inactive
given Schema[User.Status] =
Schema.derivedEnumeration.defaultStringBased
case class Account(users: List[User], status: Account.Status)
object Account:
enum Status
case Active, Inactive
given Schema[Account.Status] =
Schema.derivedEnumeration.defaultStringBased
The issue that we are seeing is that when we generate the OpenAPI documentation, the names of the two Status enums get their types mangled into Status1 and Status2. Is there a way, perhaps an annotation I can add to the enums, to give them nicer names like UserStatus and AccountStatus without having to resort to renaming the enums themselves?