Andrey Tabakov
06/15/2022, 11:51 AMis
is omitted while serialization?
I have data class
@Serializable
public data class Config(
val isVariable: String,
val anotherVariable: String
)
Config("omit", "value")
Output will be:
{anotherVariable:"value"}
P.S. isVariable should be boolean, I know, anyway it should be a String in my caseephemient
06/15/2022, 12:28 PM{"isVariable":"omit","anotherVariable":"value"}
(Kotlin 1.7.0, kotlinx.serialization 1.3.3). do you have a default vaule of isVariable
?Andrey Tabakov
06/15/2022, 12:29 PMAndrey Tabakov
06/15/2022, 12:32 PMinstall(ContentNegotiation) {
json(
Json {
ignoreUnknownKeys = true
isLenient = true
}
)
}
serialization (encodeToString) works fine