Commit f17ca59
fix: Handle arrays of enum strings correctly (#6156)
* Handle arrays of enum strings correctly
Without this change an array of enums will result in e.g.:
export type Model1 = {
values: 'A' | 'B' | 'C'[];
} & Record<string, any>;
which means the value can be either "A", "B", or "C"[], which is wrong.
* chore: add tests covering array-of-enums types
* chore: add changeset
* chore: fmt
* chore: move stringArrayEnum into TestEntity & rm singleValueArrayEnum
* chore: remove outdated files
---------
Co-authored-by: David Knaack <[email protected]>
Co-authored-by: Deeksha Sinha <[email protected]>1 parent 25386b1 commit f17ca59
File tree
14 files changed
+35
-63
lines changed- .changeset
- packages/openapi-generator/src/file-serializer
- test-packages/test-services-openapi/swagger-yaml-service/schema
- test-resources/openapi-service-specs/specifications
14 files changed
+35
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
306 | 318 | | |
307 | 319 | | |
308 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
0 commit comments