Skip to content

Commit

Permalink
Kotlin: Correct data_class.mustache to use proper property for inner …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
redwarp authored and wing328 committed Feb 18, 2018
1 parent cddcda0 commit c599906
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),

Expand Down

0 comments on commit c599906

Please sign in to comment.