Skip to content

fix: relax response-DTO schemas from .strict() to .passthrough()#41

Merged
caballeto merged 2 commits into
mainfrom
fix/alerting-null-wall-integration-library
Jun 16, 2026
Merged

fix: relax response-DTO schemas from .strict() to .passthrough()#41
caballeto merged 2 commits into
mainfrom
fix/alerting-null-wall-integration-library

Conversation

@caballeto

Copy link
Copy Markdown
Member

Summary

  • Response-shape DTOs (*Dto, *Response, SingleValueResponse*, TableValueResult*, CursorPage*) now use .passthrough() instead of .strict() so new fields added to the API don't break surfaces built against an older spec.
  • Request schemas keep .strict() for typo detection in user input.
  • Implements Postel's Law: strict on requests, tolerant on responses.

Motivation

Adding enabled to AlertChannelDto in the API broke all surfaces because the generated Zod schemas reject unknown response fields. This is a systemic fix — every future API field addition will now be backward-compatible for all published surface versions.

Test plan

  • npm run typecheck passes
  • Schema regeneration produces .passthrough() on DTOs, .strict() on requests
  • Monorepo surface integration tests pass with this branch (auto-paired by matching branch name)

Made with Cursor

caballeto and others added 2 commits June 16, 2026 16:56
Response-shape DTOs now use .passthrough() so new fields added to
the API don't break surfaces built against an older spec. Request
schemas keep .strict() for typo detection in user input.

Implements Postel's Law: strict on requests, tolerant on responses.

Co-authored-by: Cursor <cursoragent@cursor.com>
Response DTOs now use .passthrough() and should accept unknown fields.
Request schemas still reject unknown fields (.strict()). Updated the
test to assert both behaviors.

Co-authored-by: Cursor <cursoragent@cursor.com>
@caballeto caballeto merged commit df6dcf6 into main Jun 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant