Skip to content

refactor(events): reuse generated event schemas and types - #459

Merged
matoous merged 2 commits into
mainfrom
md/reuse-event-types
Nov 8, 2026
Merged

matoous merged 2 commits into
mainfrom
md/reuse-event-types

Conversation

@matoous

@matoous matoous commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Event handling defined its own envelope and resource-reference fields even though the generated SDK already provides these schemas. Extend WebhooksEvent, reuse EventObject directly, and use EventType and EventObjectType in dispatch and generated event classes.

Use the generated models' string validation instead of separate nonempty-string validators. Keep signature verification, read-only event discriminators, timezone-aware timestamps, object-type matching, unknown-event fallback, and typed resource fetching. Per-event literals remain to validate each callback's event type. Update the generator template and regenerate the SDK.

Validation: all 190 Python tests pass, along with Ruff lint/format checks and ty type checking. Generator tests passed for the template change. Coverage verifies generated-schema compatibility and future object types.

@matoous matoous self-assigned this Nov 8, 2026
@matoous
matoous marked this pull request as ready for review November 8, 2026 12:09
@matoous
matoous merged commit e231000 into main Nov 8, 2026
17 checks passed
@matoous
matoous deleted the md/reuse-event-types branch November 8, 2026 12:10
@sumup-release-bot sumup-release-bot Bot mentioned this pull request Nov 8, 2026
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