Skip to content

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

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

fix: relax response-DTO schemas from .strict() to .passthrough()#51
caballeto merged 1 commit 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-authored input (CLI flags, YAML configs).
  • 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
  • npm run build passes
  • Verified AlertChannelDto uses .passthrough(), CreateAlertChannelRequest keeps .strict()
  • Monorepo surface integration tests pass with this branch (auto-paired by matching branch name)

Made with Cursor

Response-shape DTOs (*Dto, *Response, SingleValueResponse*,
TableValueResult*, CursorPage*) 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>
@caballeto caballeto merged commit 6d7cdeb 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