Loading lesson…
Level 1 · Apprentice0 XP
Turn objects into JSON and back, safely and without reflection.
Step 1 / 6
ProblemThe server adds a new field to its JSON. The app's parser fails on unknown keys and every user sees an error screen.
← → step
Before this: Testing Kotlin: JUnit, MockK and coroutine tests
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Model an API with a sealed event type (OrderPlaced, OrderShipped) using kotlinx.serialization. Decode a list of mixed events, tolerate unknown fields, and reject invalid values in init blocks.