How to Define Validated Newtypes and Collect Every Validation Error
Wrap ISBNs, titles and prices in types that only a check can build, enforce the check in every codec, and report all errors at once.
How to Use Iron Refined Types and Typed IDs with Schema
Derive Schema and JSON codecs for case classes with Iron refined fields, read constraint failures, and keep entity IDs apart with one generic Id type.
How to Derive Your Own Type Class from a Schema
Write a Deriver for your own type class, here a log redactor that masks sensitive fields, and derive it for any type with a Schema.
How to Compute, Store and Replay Changes with Diff and Patch
Diff two versions of a value, store the patch as JSON, apply it with the right PatchMode, replay an edit history, and send JSON patches.
How to Build a Schema Registry with DynamicSchema
Store versioned event schemas as data, check incoming events against them, rebind them to Scala types, and compare versions.
How to Use Scala 3 Named Tuples with Schema
Derive a Schema for a Scala 3 named tuple, round-trip it through JSON, update fields with optics and convert it to a case class.
How to Generate JSON Schema from a Type and Validate Payloads Against It
Derive a draft 2020-12 JSON Schema contract from a case class, publish it, and validate raw JSON payloads against it or an external schema.