So far I managed to generate values with macros, and this works:
sealed trait MyEnum
@SwaggerEnum // <-- macro that generates valuesStr as a constant
MyEnum {
[...]
}
case class MyModel(
@ApiModelProperty(dataType = "string", allowableValues = MyEnum.valuesStr)
key: MyEnum
)
However, what I would like now is to attach this metadata to the @ApiModel
of the enum, not to the property so I don't have to repeat it everywhere I
use the enum. Is it possible?
On 21 December 2017 at 14:45, Erwan Loisant <[email protected]> wrote:
> Hi,
>
> In my project I'm using enumeratum extensively: https://github.
> com/lloydmeta/enumeratum
>
> It's a really popular for enumerated types in Scala (they're even
> considering to make it part of the default API, as the current Scala enum
> is really lacking).
>
> However I can't find a good way to document it without having to repeat
> all the possible values in 'allowableValues'.
>
> Did anyone had any success documenting an API exposing enumeratum enums?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Swagger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/swagger-swaggersocket/BwSeMG2mWp4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Erwan Loisant
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.