forked from loafle/openapi-generator-original
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:
parent
cddcda0fe0
commit
c599906f1a
@ -16,7 +16,7 @@ data class {{classname}} (
|
|||||||
* {{{description}}}
|
* {{{description}}}
|
||||||
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||||
*/
|
*/
|
||||||
enum class {{nameInCamelCase}}(val value: {{dataType}}){
|
enum class {{nameInCamelCase}}(val value: {{datatype}}){
|
||||||
{{#allowableValues}}{{#enumVars}}
|
{{#allowableValues}}{{#enumVars}}
|
||||||
{{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
|
{{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
|
||||||
{{/enumVars}}{{/allowableValues}}
|
{{/enumVars}}{{/allowableValues}}
|
||||||
|
@ -35,7 +35,7 @@ data class Order (
|
|||||||
* Order Status
|
* Order Status
|
||||||
* Values: placed,approved,delivered
|
* Values: placed,approved,delivered
|
||||||
*/
|
*/
|
||||||
enum class Status(val value: kotlin.Any){
|
enum class Status(val value: kotlin.String){
|
||||||
|
|
||||||
placed("placed"),
|
placed("placed"),
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ data class Pet (
|
|||||||
* pet status in the store
|
* pet status in the store
|
||||||
* Values: available,pending,sold
|
* Values: available,pending,sold
|
||||||
*/
|
*/
|
||||||
enum class Status(val value: kotlin.Any){
|
enum class Status(val value: kotlin.String){
|
||||||
|
|
||||||
available("available"),
|
available("available"),
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user