Skip to content

Commit 709c20f

Browse files
authored
Merge branch 'main' into fix/typescript-name
2 parents bac8525 + 8273845 commit 709c20f

File tree

132 files changed

+643
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+643
-334
lines changed

examples/openapi-ts-tanstack-angular-query-experimental/angular.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,8 @@
7171
}
7272
}
7373
}
74+
},
75+
"cli": {
76+
"analytics": false
7477
}
7578
}

packages/openapi-ts-tests/test/__snapshots__/2.0.x/body-response-text-plain/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

packages/openapi-ts-tests/test/__snapshots__/2.0.x/form-data/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/client/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ export const createClient = (config: Config = {}): Client => {
143143
};
144144
}
145145

146-
let error = await response.text();
146+
const textError = await response.text();
147+
let jsonError: unknown;
147148

148149
try {
149-
error = JSON.parse(error);
150+
jsonError = JSON.parse(textError);
150151
} catch {
151152
// noop
152153
}
153154

155+
const error = jsonError ?? textError;
154156
let finalError = error;
155157

156158
for (const fn of interceptors.error._fns) {

0 commit comments

Comments
 (0)