Commit 2b659f0
authored
Fix missing | None for nullable enum literals in TypedDict (#2991)
* Fix missing | None for nullable enum literals in TypedDict
* Update expected output for MultipleTypeEnum with | None
* Guard against all-None enums producing empty Literal
* Remove unreachable empty-literal guard1 parent 992af20 commit 2b659f0
File tree
6 files changed
+67
-3
lines changed- src/datamodel_code_generator/parser
- tests
- data
- expected/main
- jsonschema
- openapi/enum_models
- jsonschema
- main/jsonschema
6 files changed
+67
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3527 | 3527 | | |
3528 | 3528 | | |
3529 | 3529 | | |
3530 | | - | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
3531 | 3534 | | |
3532 | 3535 | | |
3533 | 3536 | | |
| |||
Lines changed: 15 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
Lines changed: 25 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4311 | 4311 | | |
4312 | 4312 | | |
4313 | 4313 | | |
| 4314 | + | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
4314 | 4335 | | |
4315 | 4336 | | |
4316 | 4337 | | |
| |||
0 commit comments