Kotlin: Correct data_class.mustache to use proper property for inner enum data type (#7597)

* Correct data_class.mustache to use proper property

The name of the property is "datatype" lowercase, as can be seen in https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java#L10

Using "dataType" does not work, and the type of the inner enum is null.

* Change in petstore
This commit is contained in:
Benoit Vermont 2018-02-18 15:44:35 +01:00 committed by William Cheng
parent cddcda0fe0
commit c599906f1a
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ data class {{classname}} (
* {{{description}}}
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
*/
enum class {{nameInCamelCase}}(val value: {{dataType}}){
enum class {{nameInCamelCase}}(val value: {{datatype}}){
{{#allowableValues}}{{#enumVars}}
{{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
{{/enumVars}}{{/allowableValues}}

View File

@ -35,7 +35,7 @@ data class Order (
* Order Status
* Values: placed,approved,delivered
*/
enum class Status(val value: kotlin.Any){
enum class Status(val value: kotlin.String){
placed("placed"),

View File

@ -37,7 +37,7 @@ data class Pet (
* pet status in the store
* Values: available,pending,sold
*/
enum class Status(val value: kotlin.Any){
enum class Status(val value: kotlin.String){
available("available"),