JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Success stories
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • Collections and Map in JSON

    Kotlin SELF
    48 level,0 lecture
    We’ll break down how Kotlin collections are serialized to JSON via kotlinx.serialization: why List and Set turn into arrays [...], how Map<String, V> becomes a JSON object {...}, what happens with non-string keys ( Map<Int, ...> → string keys), and when it’s better to choose the List<Entry> format instead of a map. At the end — selection criteria and common integration mistakes.
    Open
  • Annotations @SerialName and @Transient

    Kotlin SELF
    48 level,1 lecture
    We break down two key annotations from kotlinx.serialization that help keep the JSON format stable: @SerialName — to bind a Kotlin property name to the required field name in JSON (compatibility with old files and external APIs), and @Transient — to exclude fields from serialization (cache, debugging, temporary values) with a mandatory safe default. Plus — typical mistakes during refactoring and when reading “old” JSON.
    Open
  • Serializing enum and sealed class: discriminator and Ok/Error

    Kotlin SELF
    48 level,2 lecture
    We break down how enum and sealed class turn into JSON via kotlinx.serialization: why it’s important to lock down external values for an enum using @SerialName, why polymorphic serialization needs a discriminator ( classDiscriminator), how to pin the Ok/ Error variants as "ok"/ "error", and why the JSON can differ when serializing via the base type vs a concrete type.
    Open
  • Custom serializer

    Kotlin SELF
    48 level,3 lecture
    We break down why you need a custom serializer in kotlinx.serialization: how to separate the internal representation (for example, Money as Long cents) from the external JSON contract (the string "12.34"), how to plug in a serializer via @Serializable( with = ...), what KSerializer<T> consists of ( descriptor, serialize, deserialize ), why it is better not to parse money via Double, and how to write fail-fast parsing with SerializationException.
    Open
  • Cyclic references

    Kotlin SELF
    48 level,4 lecture
    We break down why cyclic references in a Kotlin object model turn JSON serialization into a “graph vs. tree” problem, which often leads to errors like StackOverflowError. We learn how to design a cycle-free “storage model” (the id-instead-of-reference strategy), how to dump state via BudgetDump, and then restore convenient in-memory links using buildState(). Finally, we cover nuances around stable identifiers, one-way models, and the role of @Transient.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success stories
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush