play-swagger
play-swagger copied to clipboard
Enumeratum Types
Im not sure if its a bug, missing feature or error on my side but currently Enumeratum types seem to be skipped by the generator.
https://github.com/lloydmeta/enumeratum
I have tried a custom type mapping that could be applied to all enumeratum types but have not been able to figure out a working format
Hi, #290 added partial support for Enumeratum. We noticed that it only works for EnumEntry
, and not ValueEnumEntry
types (e.g. StringEnumEntry
or IntEnumEntry
).
The current implementation specifically looks for a method called entryName
via reflection. Unfortunately, this method only exists for EnumEntry
. ValueEnumEntry
has a method called value
instead.
@gabfssilva @kailuowang Do you think it is reasonable to extend the current implementation to check first for enumEntry
, and then for value
? If that makes sense to you, I could try to provide a pull request for this. :)
Seems fine to me. ;)
I would welcome a PR as well.