mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
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}}}
|
||||
* 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}}
|
||||
|
@ -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"),
|
||||
|
||||
|
@ -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"),
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user