Files
openapi-generator/modules/swagger-codegen/src/main/resources/kotlin-client/enum_class.mustache
Jim Schubert ef07a02a01 [kotlin] Support nested enums in models (#5769)
* [kotlin] Add model enum support

Model variables marked isEnum=true are nested class enums. Top-level
enums will not be isEnum=true, but rather have a datatype specific to
the enum's type.

* [kotlin] Regenerate client sample
2017-06-05 00:04:58 +08:00

9 lines
375 B
Plaintext

/**
* {{{description}}}
* Values: {{#allowableValues}}{{#enumVars}}{{name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
*/
enum class {{classname}}(val value: {{dataType}}){
{{#allowableValues}}{{#enumVars}}
{{name}}({{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
{{/enumVars}}{{/allowableValues}}
)