Safely Handling Dynamic Data with TypeScript
summary
Claims that compile-time types can match runtime checks by deriving TypeScript types from JSON Schema with TypeBox, and wiring those schemas into Fastify so AJV validates requests before the handler runs. Demonstrates a concrete Fastify POST route, shows VS Code hover types, and proves body.name is a string and body.age is number|undefined at runtime — effectively closing the gap between TypeBox-derived static types and Fastify+AJV runtime validation.
AI-written summary · about
chapters (6)
- 0:00Introduction to dynamic data
- 2:36Challenges of TypeScript
- 5:49Introduction to JSON schema
- 8:28Leveraging TypeBox
- 12:40Implementing type safety
- 15:44Code demonstration and wrap
related talks
17mSafely Handling Dynamic Data with TypeScript
39mJSONSchema as a runtime type system - Advanced concepts and practical uses
17mWhy You Should Maintain Type Definitions for Your JavaScript Project
21mThe long-tail of type safety
21mThe long-tail of type safety
29mThe Lies we Tell Ourselves using TypeScript
21mBeyond Type Checking Building Bulletproof TypseScript Applications
39mEnd to end typing for web applications
