Swagger to understand Scala types
Currently this project doesn't work correctly with native Scala types like Option, Iterables and Enums.
{
"userId": 0,
"activityType": {},
"timestamp": "2022-03-10T12:15:50",
"value": {
"empty": true,
"defined": true
}
}
https://github.com/quarkusio/quarkus/discussions/43812.
Not sure how to get it working correctly even with help from MikeEdgar
From my understanding, this should be added in https://github.com/smallrye/smallrye-open-api or in a new library that adds the Scala types to the smallrye openapi generator. Os course the scala 3 Quarkus extension could also host this.
I'm not too versed into the smallrye code so it's I can't help much... at least now.
About having your enum ActivityType class being shown as a String, you can annotate it like:
@Schema(implementation = classOf[ActivityType])
enum ActivityType {
case Login, JurisdictionChange, Bet, Deposit, Withdrawal
}
See if it helps.
Still investigating on how to handle Option.
Thanks @carlosedp , this worked for the enum!
Nice, let's keep this open to track eventual workarounds or updates.