Commit 025eceb
Restore pre-TypedDict JSON dict overload when generate-typeddict is false
When generate-typeddict: false, the opt-out now performs a true revert to
pre-TypedDict behavior by restoring the standalone raw-JSON dict @overload
(and JSON in the impl Union) for both the explicit/model body path and the
spread path, instead of only dropping the TypedDict overload.
- add_overloads_for_body_param: only skip the single-body JSON overload when
a TypedDict overload was actually inserted; otherwise keep it.
- add_body_param_type: insert the raw-JSON (any-object) overload via new
_insert_json_overload helper when TypedDict generation is disabled.
- Update test_typeddict_overloads.py opt-out tests to assert the restored
[model, JSON, binary] / flattened+JSON+binary overload sets.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 753f3788-98a9-4e39-8655-9c6a3ce905361 parent be122e6 commit 025eceb
2 files changed
Lines changed: 46 additions & 15 deletions
File tree
- packages/http-client-python
- generator/pygen/preprocess
- tests/unit
Lines changed: 34 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
402 | 424 | | |
403 | 425 | | |
404 | 426 | | |
| |||
447 | 469 | | |
448 | 470 | | |
449 | 471 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
455 | 481 | | |
456 | 482 | | |
457 | 483 | | |
| |||
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
123 | | - | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
145 | 150 | | |
146 | 151 | | |
147 | 152 | | |
| |||
0 commit comments