Commit 5c1e7d9
committed
Discriminate history exports response union
The index_exports endpoint returns either JobExportHistoryArchiveListResponse
or ExportTaskListResponse depending on the Accept header. Without a
discriminator Pydantic walks the union left-to-right at serialization and
warns "Expected JobExportHistoryArchiveListResponse" for every task-based
response. Add a callable Discriminator that routes by instance type, matching
the pattern used for the nested export payload union.1 parent c116c65 commit 5c1e7d9
1 file changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
189 | 206 | | |
190 | 207 | | |
191 | 208 | | |
| |||
551 | 568 | | |
552 | 569 | | |
553 | 570 | | |
554 | | - | |
| 571 | + | |
555 | 572 | | |
556 | 573 | | |
557 | 574 | | |
| |||
0 commit comments