Commit 2051669
feat: add AdCPBaseModel with exclude_none serialization (#40)
* feat: add AdCPBaseModel with exclude_none serialization
AdCP JSON schemas use `additionalProperties: false` and don't allow null
for optional fields. Optional fields must be omitted entirely when not present.
Changes:
- Create AdCPBaseModel base class with exclude_none=True by default
- Update code generator to use AdCPBaseModel instead of BaseModel
- Regenerate all models with new base class
- Export AdCPBaseModel from adcp.types
This ensures spec-compliant JSON serialization where None values are
omitted from the output instead of being sent as null.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: add type annotations to AdCPBaseModel methods
Add proper type annotations to model_dump() and model_dump_json()
to satisfy mypy strict type checking.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 371e30c commit 2051669
File tree
4 files changed
+36
-2
lines changed- scripts
- src/adcp/types
4 files changed
+36
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
504 | 505 | | |
505 | 506 | | |
506 | 507 | | |
| |||
723 | 724 | | |
724 | 725 | | |
725 | 726 | | |
726 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
727 | 730 | | |
728 | 731 | | |
729 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
945 | 947 | | |
946 | 948 | | |
947 | 949 | | |
| 950 | + | |
948 | 951 | | |
949 | 952 | | |
950 | 953 | | |
| |||
0 commit comments