Skip to content

fix: relax response-DTO models from extra='forbid' to extra='ignore'#46

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

fix: relax response-DTO models from extra='forbid' to extra='ignore'#46
caballeto merged 2 commits into
mainfrom
fix/alerting-null-wall-integration-library

Conversation

@caballeto

Copy link
Copy Markdown
Member

Summary

  • Response-shape Pydantic models (*Dto, *Response) now use extra='ignore' instead of extra='forbid' so new fields added to the API don't break surfaces built against an older spec.
  • Request-shape models keep extra='forbid' for validation of user input.
  • Implements Postel's Law: strict on requests, tolerant on responses.

Motivation

Adding enabled to AlertChannelDto in the API broke all surfaces because Pydantic models with extra='forbid' 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

  • inject_strict_config.py correctly classifies DTOs vs Requests
  • AlertChannelDto gets extra='ignore', CreateAlertChannelRequest keeps extra='forbid'
  • 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 classes (*Dto, *Response) now use extra='ignore' so
new fields added to the API don't break surfaces built against an
older spec. Request classes keep extra='forbid' for validation.

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

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@caballeto caballeto merged commit 332c034 into main Jun 16, 2026
4 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