forked from loafle/openapi-generator-original
fix: changed Any to kotlin.Any (#10985)
This commit is contained in:
committed by
GitHub
parent
3b5345eb57
commit
8e2e200e18
@@ -67,12 +67,12 @@ import kotlinx.serialization.*
|
||||
/**
|
||||
* Converts the provided [data] to a [String] on success, null otherwise.
|
||||
*/
|
||||
fun encode(data: Any?): kotlin.String? = if (data is {{classname}}) "$data" else null
|
||||
fun encode(data: kotlin.Any?): kotlin.String? = if (data is {{classname}}) "$data" else null
|
||||
|
||||
/**
|
||||
* Returns a valid [{{classname}}] for [data], null otherwise.
|
||||
*/
|
||||
fun decode(data: Any?): {{classname}}? = data?.let {
|
||||
fun decode(data: kotlin.Any?): {{classname}}? = data?.let {
|
||||
val normalizedData = "$it".lowercase()
|
||||
values().firstOrNull { value ->
|
||||
it == value || normalizedData == "$value".lowercase()
|
||||
|
||||
@@ -50,12 +50,12 @@ enum class PetEnum(val value: kotlin.String) {
|
||||
/**
|
||||
* Converts the provided [data] to a [String] on success, null otherwise.
|
||||
*/
|
||||
fun encode(data: Any?): kotlin.String? = if (data is PetEnum) "$data" else null
|
||||
fun encode(data: kotlin.Any?): kotlin.String? = if (data is PetEnum) "$data" else null
|
||||
|
||||
/**
|
||||
* Returns a valid [PetEnum] for [data], null otherwise.
|
||||
*/
|
||||
fun decode(data: Any?): PetEnum? = data?.let {
|
||||
fun decode(data: kotlin.Any?): PetEnum? = data?.let {
|
||||
val normalizedData = "$it".lowercase()
|
||||
values().firstOrNull { value ->
|
||||
it == value || normalizedData == "$value".lowercase()
|
||||
|
||||
Reference in New Issue
Block a user