Commit bc9bd7b
committed
feat: add raw_json() to the event returned by webhook verification
from_dict reads only the properties it was generated for, so a field Seam adds
to an existing event between SDK releases is silently discarded. #651 made
parsing degrade instead of raise, but did not keep the payload, so there was no
way to reach a new field short of upgrading.
SeamWebhook.verify() now returns an event carrying raw_json():
json.loads(event.raw_json())["a_field_this_version_predates"]
DeepAttrDict answers the same call, so the unrecognized-event branch and the
typed branch are handled the same way. This matters because the fallback is not
otherwise interchangeable with a generated event: reading a missing key raises
AttributeError where a dataclass returns None, so generic code written against
the declared union breaks on it.
Scoped to events. It is there for the verify return, not as a general accessor
on every model. A method rather than a property because the call is where the
serialization happens; the event retains the decoded payload and serializes on
demand. The retained payload is repr=False and compare=False, so it changes
neither the repr nor equality.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2kJ4nGaM8imZCVMEKjmXA1 parent 4bab5aa commit bc9bd7b
6 files changed
Lines changed: 726 additions & 5 deletions
File tree
- codegen
- layouts
- partials
- lib/layouts
- seam
- resources
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
40 | 54 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
706 | | - | |
707 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
708 | 711 | | |
709 | 712 | | |
710 | 713 | | |
| |||
718 | 721 | | |
719 | 722 | | |
720 | 723 | | |
721 | | - | |
| 724 | + | |
| 725 | + | |
722 | 726 | | |
723 | 727 | | |
724 | 728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
0 commit comments