Course · 28 lessons

Data and Formats

Read, validate, transform, and display JSON, text, dates, and numbers.

  1. Serialize a small model

    Turn public data properties into a JSON document.

    Core ideas · 10 min
  2. Deserialize and validate

    Treat a decoded object as input that still needs checking.

    Core ideas · 10 min
  3. Naming policies

    Choose consistent external property names.

    Core ideas · 10 min
  4. Inspect a JSON document

    Read selected fields without defining a complete object model.

    Core ideas · 10 min
  5. Malformed JSON

    Handle syntax errors at the import boundary.

    Working with data · 10 min
  6. Invariant numeric parsing

    Make machine-readable decimal text independent of display language.

    Working with data · 10 min
  7. Dates without time zones

    Use DateOnly when the domain means a calendar date.

    Working with data · 10 min
  8. UTF-8 is bytes

    Distinguish a string’s characters from its encoded length.

    Working with data · 10 min
  9. Base64 is representation

    Encode bytes for a text-only channel without claiming encryption.

    Putting it together · 10 min
  10. Line-oriented text

    Choose clear rules for whitespace and empty records.

    Putting it together · 10 min
  11. Escaping CSV fields

    Protect separators and quotes when exporting tabular text.

    Putting it together · 10 min
  12. A validated import pipeline

    Separate decoding, validation, calculation, and display.

    Putting it together · 10 min
  13. Missing properties and explicit JSON null

    Preserve the difference between absent, null, and ordinary default values.

    Deeper practice · 18 min
  14. JSON property matching is an explicit option

    Decide whether differently cased wire names identify the same property.

    Deeper practice · 18 min
  15. Rejecting unknown JSON members

    Use strict schema boundaries when silently ignored fields would hide mistakes.

    Deeper practice · 18 min
  16. Required JSON presence is not nonnull content

    Check presence, nullability, and business meaning as separate contracts.

    Deeper practice · 18 min
  17. String enums with an explicit numeric policy

    Make wire values readable while deciding whether unknown numeric values are accepted.

    Deeper practice · 18 min
  18. Numeric strings are a compatibility choice

    Allow quoted numbers only when the schema intentionally permits them.

    Deeper practice · 18 min
  19. JsonElement lifetime and Clone

    Return independent JSON data instead of a view owned by a disposed document.

    Deeper practice · 18 min
  20. Enumerating JSON objects without a fixed model

    Inspect a bounded object while validating each property kind.

    Deeper practice · 18 min
  21. Omitting null and omitting defaults are different

    Choose serialization rules without erasing meaningful zero and false values.

    Applied techniques · 18 min
  22. Property attributes override a general naming policy

    Preserve a stable external name for one member while applying a broader convention.

    Applied techniques · 18 min
  23. Offsets represent instants without naming a time zone

    Parse an explicit offset and preserve its relationship to UTC.

    Applied techniques · 18 min
  24. Rounding mode and rounding stage

    Make numeric presentation rules explicit before aggregating rounded values.

    Applied techniques · 18 min
  25. Parsing one CSV row with quoted fields

    Track quoting state instead of splitting blindly at every comma.

    Applied techniques · 18 min
  26. Escaping a URI component

    Encode data as one component rather than accidentally adding query syntax.

    Applied techniques · 18 min
  27. UTF-16 units and Unicode scalar values

    Avoid treating string.Length as a universal count of visible characters.

    Applied techniques · 18 min
  28. Stable property ordering for an application export

    Define a deterministic output order without claiming a universal canonical JSON format.

    Applied techniques · 18 min