JSONSchema as a runtime type system - Advanced concepts and practical uses
summary
Shows how JSON Schema models runtime types end to end: primitives, arrays, objects, recursion via $ref/$id, generics via dynamicRef and $defs, ADTs with oneOf/anyOf, and structural dependent constraints (if country == "United States of America" then postalCode matches regex). Demos use AJV and Hyperjump validators, extend AJV with a custom keyword to validate graph edges, use json-schema-faker for mock data, and TypeBox (with a JIT compiler) to share one definition between TypeScript compile-time and runtime. Structured generation constrains LLM output to valid JSON and the examples validate successfully.
AI-written summary · about
chapters (11)
- 0:00JSONSchema as runtime type system
- 1:09JSONSchema fits runtime validation
- 5:01JSONSchema primitives and constraints
- 8:17Recursion in schemas
- 9:59Algebraic data types with generics
- 13:55Dependent types and validation
- 18:35Extending JSONSchema with custom vocabularies
- 22:50Compile-time versus runtime types
- 27:05LLMs and structured JSON output
- 33:15JSONSchema future directions
- 39:02Q&A
related talks
25mJSON Schema - draft 2020 and other things you should know
25mFull-stack forms with JSON Schemas
20mSafely Handling Dynamic Data with TypeScript
32mJSON Standards for the Web
04mLightning Talk JSON Schema
21mThe long-tail of type safety
39mEnd to end typing for web applications
21mThe long-tail of type safety
