Hey, so maybe someone know why with this code: ```...
# serialization
m
Hey, so maybe someone know why with this code:
Copy code
@Serializable
data class SerializableTransformation(
  val translateX: Float = 0f,
  val translateY: Float = 0f,
  val rotateY: Float = 0f
)
kotlinx-serialization give me an exception:
Copy code
Exception in thread "main" kotlinx.serialization.MissingFieldException: Field 'rotateY' is required, but it was missing
I thought that default values make fields optional for serialization, but maybe I'm wrong Thanks in advance K
r
create a
Json
object with a custom configuration:
Copy code
val nonstrictJson = Json(
        configuration = JsonConfiguration.Stable.copy(ignoreUnknownKeys = true)
    )
p
@Robert Jaros that's not the solution, the key is known
r
@Paul Woitaschek you are probably right, I didn't look close enough at these new config options
p
That's more for the case where it's really unknown
Ie If the json contained rotateZ
t
isLenient
flag responsibility?
Does it responsible for this behaviour?