Commit 196c2fd
committed
fix: serialize Pydantic models in request body
Issue:
- ExtraInfo class instance submitted as the extra_info parameter is not serialized and
results in: "TypeError: Object of type ExtraInfo is not JSON serializable"
This fix will:
- Serialize BaseModel instances.
- Exclude None values (automatically populated for defined model properties and rejected
by the API)
This will allow users to pass as extra_info parameter:
- ExtraInfo instance (as hinted)
- Dictionary1 parent a71d1fa commit 196c2fd
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
| |||
0 commit comments