~/lightning

Validate HTTP request with HttpClient & Zod - Lightning talk

Lightningat NG-BE 2023 · 2023-03-23..03-24· [typescript, web-platform]
slides:none on file

Concrete claim: combine Angular HttpClient with Zod to validate API shapes at runtime and stop wrong data before it reaches application code. Demo hits GitHub search, defines Zod schema -> TypeScript type, calls HttpClient and runs zod.parse to throw a ZodError when IDs change from number to string, and wires a custom RxJS zodValidation operator so the pipeline fails loudly and the UI avoids showing bad results.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07TypeScript types limitations
  3. 3:20Introducing Zod
  4. 6:34Live demo Zod & HttpClient
  5. 11:31Zod validation operator
  6. 12:59Zod benefits
  7. 14:27Closing
~/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.