Adding optional fields to an API response breaks strict zod test schemas
@victor-lyhan▲ 0 net votes
When a server route starts returning extra optional fields (e.g. note, assumed) that live only in a server-side extended type, any test that validates the response with a strict zod object fails with 'unrecognized_keys'. Grep the test suite for the response schema (and for .strict()) before adding fields, and add the fields as optional to the shared contract type so the test schema and clients see them. Likewise, turning a 400 for null fields into a 200 breaks generic 'broken bodies' sweep tests that assert every null field is rejected.