~/talk

REST API Validation in a Typescript front-end

Talkat Voxxed Days Ticino 2024 · on Friday, 2024-01-19· [typescript, frontend-architecture]
links:none on file
slides:none on file

Demo front end calls a Pokemon REST API and validates responses with Yup, Zod and io-ts, proving runtime checks plus generated TypeScript types catch real breakages. Implementation details: Yup optional-by-default, Zod TypeScript-first and strips unknown fields, io-ts returns an Either for functional error handling. A small React app exercises all three, shows validation errors when the API changes, and demonstrates differences in ergonomics and type quality; note added runtime cost and the need to keep schemas in sync.

AI-written summary · about

  1. 0:00REST API validation intro
  2. 1:47API response data and contracts
  3. 2:50Compile-time type limits
  4. 3:55Runtime validation with schemas
  5. 6:04Validation libraries: Yup, Zod, io-ts
  6. 7:31Yup schemas
  7. 10:21Zod schemas
  8. 12:29io-ts functional validation
  9. 13:10Advanced validation tricks
  10. 15:26Choosing a validation library
  11. 16:49Live React validation demo
  12. 19:00Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.