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
  • JsonElement as a JSON tree

    Kotlin SELF
    49 level,0 lecture
    We break down how to use JsonElement as a “JSON tree” in kotlinx.serialization: parse text via Json.parseToJsonElement(...), distinguish JsonObject/ JsonArray/ JsonPrimitive/ JsonNull, safely navigate nodes with when and as?, and also avoid confusing “the field is missing” with “the field exists, but is null”.
    Open
  • Safe data extraction from a JSON tree

    Kotlin SELF
    49 level,1 lecture
    We break down the practice of safe navigation through a JSON tree in kotlinx.serialization: how to work with JsonElement/ JsonObject without crashes, why JsonElement? shows up everywhere, how “key is missing” differs from JsonNull, and how to package extraction into predictable helper functions ( getStringOrNull, getIntOrNull, getObjectOrNull, getArrayOrNull). Separately: safe conversions via toIntOrNull()/ toDoubleOrNull()/ toBooleanStrictOrNull() and common mistakes ( !!, toInt(), early defaults).
    Open
  • JSON Data Validation

    Kotlin SELF
    49 level,2 lecture
    We will walk through a practical pipeline for processing incoming JSON in Kotlin: we separate parsing text into JsonElement from validating structure and business rules, design a result contract via ValidationResult ( Ok/ Error) instead of Boolean, write helper functions for safe field reading, and build an expense-import validator for a CLI (including fail-fast with the item index).
    Open
  • Building JSON by hand — reports and non-standard structures

    Kotlin SELF
    49 level,3 lecture
    We break down how to manually assemble JSON reports in Kotlin via the JsonElement tree: compute aggregates separately, then pack them using buildJsonObject/ buildJsonArray, use JsonPrimitive and JsonNull, distinguish “no field” vs “field = null”, and also combine manual assembly with Json.encodeToJsonElement and get pretty output via prettyPrint.
    Open
  • JSON vs XML — practical criteria for choosing a format

    Kotlin SELF
    49 level,4 lecture
    We break down how to consciously choose between JSON and XML: “data vs document”, primitive typing ( true, 123, "text", null), lists, attributes, ordering, and schemas/validation. Using Kotlin examples, we show why a JsonElement tree is convenient for unstable structures, why it’s worth separating parsing from business validation, and why it’s better to generate via buildJsonObject rather than by concatenating strings.
    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