Skip to content

Commit bfa2c5b

Browse files
authored
Merge pull request #2151 from hey-api/fix/crash-report
fix(typescript): handle nested inline objects with write/read only fields
2 parents f0294b4 + aef80c3 commit bfa2c5b

File tree

28 files changed

+445
-180
lines changed

28 files changed

+445
-180
lines changed

.changeset/bright-rats-mix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': patch
3+
---
4+
5+
fix: add crash report prompt

.changeset/twenty-numbers-talk.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
'@hey-api/client-custom': minor
32
'@hey-api/client-axios': minor
4-
'@hey-api/client-fetch': minor
53
'@hey-api/client-core': minor
4+
'@hey-api/client-custom': minor
5+
'@hey-api/client-fetch': minor
66
'@hey-api/client-next': minor
7-
'@hey-api/client-nuxt': minor
87
---
98

10-
feat: export buildClientParams function
9+
feat: export `buildClientParams` function

.changeset/warm-lemons-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': patch
3+
---
4+
5+
fix(typescript): handle nested inline objects with write/read only fields

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ export type WritableQuux = {
2929
baz?: Array<Baz>;
3030
};
3131

32+
export type ReadableCorge = {
33+
foo?: string;
34+
bar?: {
35+
readonly baz?: boolean;
36+
};
37+
};
38+
39+
export type WritableCorge = {
40+
foo?: string;
41+
};
42+
3243
export type PostFooReadData = {
3344
body: WritableFooRead;
3445
path?: never;

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ export type Quux = {
2121
qux?: QuxAllRead;
2222
};
2323

24+
export type Corge = {
25+
foo?: string;
26+
bar?: {
27+
readonly baz?: boolean;
28+
};
29+
};
30+
2431
export type PostFooReadData = {
2532
body: FooRead;
2633
path?: never;

packages/openapi-ts-tests/test/__snapshots__/2.0.x/read-write-only/types.gen.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ export type QuuxWritable = {
2929
baz?: Array<Baz>;
3030
};
3131

32+
export type CorgeReadable = {
33+
foo?: string;
34+
bar?: {
35+
readonly baz?: boolean;
36+
};
37+
};
38+
39+
export type CorgeWritable = {
40+
foo?: string;
41+
};
42+
3243
export type PostFooReadData = {
3344
body: FooReadWritable;
3445
path?: never;

packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ export type WritableQuux = {
4747
baz?: Array<Baz>;
4848
};
4949

50+
export type ReadableCorge = {
51+
bar?: {
52+
readonly baz?: boolean;
53+
};
54+
};
55+
56+
export type WritableCorge = {
57+
foo?: {
58+
baz?: boolean;
59+
};
60+
};
61+
5062
export type PostFooReadWriteData = {
5163
body: WritableFooReadWrite;
5264
path?: never;

packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/read-write-only-ignore/types.gen.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ export type Quux = {
3333
qux?: QuxAllRead;
3434
};
3535

36+
export type Corge = {
37+
foo?: {
38+
baz?: boolean;
39+
};
40+
bar?: {
41+
readonly baz?: boolean;
42+
};
43+
};
44+
3645
export type PostFooReadWriteData = {
3746
body: FooReadWrite;
3847
path?: never;

packages/openapi-ts-tests/test/__snapshots__/3.0.x/read-write-only/types.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ export type QuuxWritable = {
4747
baz?: Array<Baz>;
4848
};
4949

50+
export type CorgeReadable = {
51+
bar?: {
52+
readonly baz?: boolean;
53+
};
54+
};
55+
56+
export type CorgeWritable = {
57+
foo?: {
58+
baz?: boolean;
59+
};
60+
};
61+
5062
export type PostFooReadWriteData = {
5163
body: FooReadWriteWritable;
5264
path?: never;

packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/read-write-only-custom-name/types.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ export type WritableQuux = {
5151
baz?: Array<Baz>;
5252
};
5353

54+
export type ReadableCorge = {
55+
bar?: {
56+
readonly baz?: boolean;
57+
};
58+
};
59+
60+
export type WritableCorge = {
61+
foo?: {
62+
baz?: boolean;
63+
};
64+
};
65+
5466
export type PostFooReadWriteData = {
5567
body: WritableFooReadWrite;
5668
path?: never;

0 commit comments

Comments
 (0)