Commit 128e322
fix: remove redundant union of property types in index signature for unknown additionalProperties
When a schema has both `properties` and `additionalProperties: {}` (or `true`),
the generator now emits `[key: string]: unknown` instead of the redundant union
`[key: string]: unknown | string | null | ... | undefined`.
- When additionalProperties is `unknown`, only use it for the index signature type
(since `unknown` already subsumes all types including `undefined`)
- For typed additionalProperties (e.g. `{ type: 'string' }`), keep current behavior
of including named property types to satisfy TypeScript's index constraint
- Update all affected test snapshots
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>1 parent 726eab2 commit 128e322
137 files changed
Lines changed: 166 additions & 171 deletions
File tree
- packages
- openapi-ts-tests
- main/test/__snapshots__
- 2.0.x/additional-properties-true
- 3.0.x
- additional-properties-true
- plugins
- @angular/common
- default-class
- default
- @hey-api/sdk
- default
- throwOnError
- @pinia/colada/fetch
- @tanstack
- angular-query-experimental
- axios
- fetch
- react-query
- axios
- fetch
- solid-query
- axios
- fetch
- svelte-query
- axios
- fetch
- vue-query
- axios
- fetch
- fastify/default
- 3.1.x
- additional-properties-true-any
- additional-properties-true
- clients
- @hey-api
- client-angular
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- clean-false
- default
- import-file-extension-ts
- sdk-client-optional
- sdk-client-required
- tsconfig-node16-sdk
- tsconfig-nodenext-sdk
- client-axios
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- clean-false
- default
- import-file-extension-ts
- sdk-client-optional
- sdk-client-required
- tsconfig-node16-sdk
- tsconfig-nodenext-sdk
- client-fetch
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- clean-false
- default
- import-file-extension-ts
- sdk-client-optional
- sdk-client-required
- tsconfig-node16-sdk
- tsconfig-nodenext-sdk
- client-ky
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- clean-false
- default
- import-file-extension-ts
- sdk-client-optional
- sdk-client-required
- tsconfig-node16-sdk
- tsconfig-nodenext-sdk
- client-next
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- clean-false
- default
- import-file-extension-ts
- sdk-client-optional
- sdk-client-required
- tsconfig-node16-sdk
- tsconfig-nodenext-sdk
- client-nuxt
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- clean-false
- default
- import-file-extension-ts
- sdk-client-optional
- sdk-client-required
- tsconfig-node16-sdk
- tsconfig-nodenext-sdk
- client-ofetch
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- clean-false
- default
- import-file-extension-ts
- sdk-client-optional
- sdk-client-required
- tsconfig-node16-sdk
- tsconfig-nodenext-sdk
- client-custom
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- bundle
- default
- sdk-client-optional
- sdk-client-required
- my-client
- base-url-false
- base-url-number
- base-url-strict
- base-url-string
- bundle
- default
- sdk-client-optional
- sdk-client-required
- plugins
- @angular/common
- default-class
- default
- @hey-api/sdk
- default
- throwOnError
- @pinia/colada/fetch
- @tanstack
- angular-query-experimental
- axios
- fetch
- react-query
- axios
- fetch
- solid-query
- axios
- fetch
- svelte-query
- axios
- fetch
- vue-query
- axios
- fetch
- fastify/default
- webhooks
- sdks/__snapshots__
- method-class-conflict
- class
- flat
- instance
- opencode
- export-all
- flat
- grouped
- openapi-ts/src/plugins/@hey-api/typescript/v1/toAst
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
0 commit comments