Correct boolean serialization
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
6ec3e96909
commit
32e7fc0038
@ -138,7 +138,11 @@ class SelfossModel {
|
|||||||
object BooleanSerializer : KSerializer<Boolean> {
|
object BooleanSerializer : KSerializer<Boolean> {
|
||||||
override fun deserialize(decoder: Decoder): Boolean {
|
override fun deserialize(decoder: Decoder): Boolean {
|
||||||
val json = ((decoder as JsonDecoder).decodeJsonElement()).jsonPrimitive
|
val json = ((decoder as JsonDecoder).decodeJsonElement()).jsonPrimitive
|
||||||
return json.booleanOrNull ?: json.int == 1
|
return if (json.booleanOrNull != null) {
|
||||||
|
json.boolean
|
||||||
|
} else {
|
||||||
|
json.int == 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override val descriptor: SerialDescriptor
|
override val descriptor: SerialDescriptor
|
||||||
|
Loading…
Reference in New Issue
Block a user