NG.VII · Angular 22 practice question

A team wants to validate API responses fetched by httpResource using Zod schemas. Which option on httpResource integrates the validation function?

Choose one answer
Check answer and explanation

Correct answer: parse

Explanation

You integrate schema validation libraries such as Zod or Valibot with httpResource by providing a parse option.

Common trap

validate is a plausible name, but httpResource expects the option to be named parse. schema is not an httpResource option; the library's parsing function is passed to parse instead.

Source: Angular docs: Reactive data fetching with `httpResource` — Response parsing and validation
Checked against the cited text on 2026-11-25.

Report an error in this question