forked from loafle/openapi-generator-original
* [Kotlin][Spring] fix #19244 integer enum * fix embedded array enum
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonCreator
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.fasterxml.jackson.annotation.JsonValue
|
||||
import java.io.Serializable
|
||||
@@ -49,11 +50,19 @@ data class Order(
|
||||
* Order Status
|
||||
* Values: placed,approved,delivered
|
||||
*/
|
||||
enum class Status(val value: kotlin.String) {
|
||||
enum class Status(@get:JsonValue val value: kotlin.String) {
|
||||
|
||||
@JsonProperty("placed") placed("placed"),
|
||||
@JsonProperty("approved") approved("approved"),
|
||||
@JsonProperty("delivered") delivered("delivered")
|
||||
placed("placed"),
|
||||
approved("approved"),
|
||||
delivered("delivered");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@JsonCreator
|
||||
fun forValue(value: kotlin.String): Status {
|
||||
return values().first{it -> it.value == value}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import java.util.Objects
|
||||
import com.fasterxml.jackson.annotation.JsonCreator
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.fasterxml.jackson.annotation.JsonValue
|
||||
import org.openapitools.model.Category
|
||||
@@ -53,11 +54,19 @@ data class Pet(
|
||||
* pet status in the store
|
||||
* Values: available,pending,sold
|
||||
*/
|
||||
enum class Status(val value: kotlin.String) {
|
||||
enum class Status(@get:JsonValue val value: kotlin.String) {
|
||||
|
||||
@JsonProperty("available") available("available"),
|
||||
@JsonProperty("pending") pending("pending"),
|
||||
@JsonProperty("sold") sold("sold")
|
||||
available("available"),
|
||||
pending("pending"),
|
||||
sold("sold");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@JsonCreator
|
||||
fun forValue(value: kotlin.String): Status {
|
||||
return values().first{it -> it.value == value}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user