play-swagger icon indicating copy to clipboard operation
play-swagger copied to clipboard

Enumeratum Types

Open benshaw opened this issue 6 years ago • 4 comments

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

benshaw avatar Jul 17 '18 16:07 benshaw

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

benshaw avatar Jul 17 '18 17:07 benshaw

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. :)

tilmanginzel avatar Aug 31 '20 09:08 tilmanginzel

Seems fine to me. ;)

gabfssilva avatar Aug 31 '20 16:08 gabfssilva

I would welcome a PR as well.

kailuowang avatar Aug 31 '20 17:08 kailuowang