fix issue where body can be empty data on a put/post #3397
Closed
Annotations
10 errors
|
Run test coverage:
packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/params.ts#L133
TypeError: Cannot set properties of undefined (setting 'q_u_x')
❯ buildClientParams src/plugins/@hey-api/client-core/bundle/params.ts:133:61
❯ src/plugins/@hey-api/client-core/__tests__/params.test.ts:350:12
❯ new ZoneAwarePromise ../../node_modules/.pnpm/zone.js@0.16.0/node_modules/zone.js/fesm2015/zone.js:2221:23
|
|
Run test coverage:
packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/params.ts#L145
TypeError: Cannot set properties of undefined (setting 'qux')
❯ buildClientParams src/plugins/@hey-api/client-core/bundle/params.ts:145:63
❯ src/plugins/@hey-api/client-core/__tests__/params.test.ts:350:12
❯ new ZoneAwarePromise ../../node_modules/.pnpm/zone.js@0.16.0/node_modules/zone.js/fesm2015/zone.js:2221:23
|
|
Run test coverage:
packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/params.ts#L145
TypeError: Cannot set properties of undefined (setting 'qux')
❯ buildClientParams src/plugins/@hey-api/client-core/bundle/params.ts:145:63
❯ src/plugins/@hey-api/client-core/__tests__/params.test.ts:350:12
❯ new ZoneAwarePromise ../../node_modules/.pnpm/zone.js@0.16.0/node_modules/zone.js/fesm2015/zone.js:2221:23
|
|
Run test coverage:
packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/params.ts#L133
TypeError: Cannot set properties of undefined (setting 'qux')
❯ buildClientParams src/plugins/@hey-api/client-core/bundle/params.ts:133:61
❯ src/plugins/@hey-api/client-core/__tests__/params.test.ts:350:12
❯ new ZoneAwarePromise ../../node_modules/.pnpm/zone.js@0.16.0/node_modules/zone.js/fesm2015/zone.js:2221:23
|
|
Run test coverage:
packages/openapi-ts-tests/sdks/test/opencode.test.ts#L78
Error: Snapshot `SDK: opencode > 'grouped' 10` mismatched
- Expected
+ Received
@@ -86,27 +86,31 @@
return map;
};
interface Params {
- body: unknown;
+ body?: unknown;
headers: Record<string, unknown>;
path: Record<string, unknown>;
query: Record<string, unknown>;
}
const stripEmptySlots = (params: Params) => {
for (const [slot, value] of Object.entries(params)) {
- if (value && typeof value === 'object' && !Object.keys(value).length) {
+ if (
+ slot !== 'body' &&
+ value &&
+ typeof value === 'object' &&
+ !Object.keys(value).length
+ ) {
delete params[slot as Slot];
}
}
};
export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsConfig) => {
const params: Params = {
- body: {},
headers: {},
path: {},
query: {},
};
❯ test/opencode.test.ts:78:11
❯ test/opencode.test.ts:75:7
|
|
Run test coverage:
packages/openapi-ts-tests/sdks/test/opencode.test.ts#L78
Error: Snapshot `SDK: opencode > 'flat' 8` mismatched
- Expected
+ Received
@@ -86,27 +86,31 @@
return map;
};
interface Params {
- body: unknown;
+ body?: unknown;
headers: Record<string, unknown>;
path: Record<string, unknown>;
query: Record<string, unknown>;
}
const stripEmptySlots = (params: Params) => {
for (const [slot, value] of Object.entries(params)) {
- if (value && typeof value === 'object' && !Object.keys(value).length) {
+ if (
+ slot !== 'body' &&
+ value &&
+ typeof value === 'object' &&
+ !Object.keys(value).length
+ ) {
delete params[slot as Slot];
}
}
};
export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsConfig) => {
const params: Params = {
- body: {},
headers: {},
path: {},
query: {},
};
❯ test/opencode.test.ts:78:11
❯ test/opencode.test.ts:75:7
|
|
Run test coverage:
packages/openapi-ts-tests/sdks/test/opencode.test.ts#L78
Error: Snapshot `SDK: opencode > 'export all' 8` mismatched
- Expected
+ Received
@@ -86,27 +86,31 @@
return map;
};
interface Params {
- body: unknown;
+ body?: unknown;
headers: Record<string, unknown>;
path: Record<string, unknown>;
query: Record<string, unknown>;
}
const stripEmptySlots = (params: Params) => {
for (const [slot, value] of Object.entries(params)) {
- if (value && typeof value === 'object' && !Object.keys(value).length) {
+ if (
+ slot !== 'body' &&
+ value &&
+ typeof value === 'object' &&
+ !Object.keys(value).length
+ ) {
delete params[slot as Slot];
}
}
};
export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsConfig) => {
const params: Params = {
- body: {},
headers: {},
path: {},
query: {},
};
❯ test/opencode.test.ts:78:11
❯ test/opencode.test.ts:75:7
|
|
Run test coverage:
packages/openapi-ts-tests/sdks/test/method-class-conflict.test.ts#L86
Error: Snapshot `SDK: method-class-conflict > 'instance' 8` mismatched
- Expected
+ Received
@@ -86,27 +86,31 @@
return map;
};
interface Params {
- body: unknown;
+ body?: unknown;
headers: Record<string, unknown>;
path: Record<string, unknown>;
query: Record<string, unknown>;
}
const stripEmptySlots = (params: Params) => {
for (const [slot, value] of Object.entries(params)) {
- if (value && typeof value === 'object' && !Object.keys(value).length) {
+ if (
+ slot !== 'body' &&
+ value &&
+ typeof value === 'object' &&
+ !Object.keys(value).length
+ ) {
delete params[slot as Slot];
}
}
};
export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsConfig) => {
const params: Params = {
- body: {},
headers: {},
path: {},
query: {},
};
❯ test/method-class-conflict.test.ts:86:11
❯ test/method-class-conflict.test.ts:83:7
|
|
Run test coverage:
packages/openapi-ts-tests/sdks/test/method-class-conflict.test.ts#L86
Error: Snapshot `SDK: method-class-conflict > 'flat' 8` mismatched
- Expected
+ Received
@@ -86,27 +86,31 @@
return map;
};
interface Params {
- body: unknown;
+ body?: unknown;
headers: Record<string, unknown>;
path: Record<string, unknown>;
query: Record<string, unknown>;
}
const stripEmptySlots = (params: Params) => {
for (const [slot, value] of Object.entries(params)) {
- if (value && typeof value === 'object' && !Object.keys(value).length) {
+ if (
+ slot !== 'body' &&
+ value &&
+ typeof value === 'object' &&
+ !Object.keys(value).length
+ ) {
delete params[slot as Slot];
}
}
};
export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsConfig) => {
const params: Params = {
- body: {},
headers: {},
path: {},
query: {},
};
❯ test/method-class-conflict.test.ts:86:11
❯ test/method-class-conflict.test.ts:83:7
|
|
Run test coverage:
packages/openapi-ts-tests/sdks/test/method-class-conflict.test.ts#L86
Error: Snapshot `SDK: method-class-conflict > 'class' 8` mismatched
- Expected
+ Received
@@ -86,27 +86,31 @@
return map;
};
interface Params {
- body: unknown;
+ body?: unknown;
headers: Record<string, unknown>;
path: Record<string, unknown>;
query: Record<string, unknown>;
}
const stripEmptySlots = (params: Params) => {
for (const [slot, value] of Object.entries(params)) {
- if (value && typeof value === 'object' && !Object.keys(value).length) {
+ if (
+ slot !== 'body' &&
+ value &&
+ typeof value === 'object' &&
+ !Object.keys(value).length
+ ) {
delete params[slot as Slot];
}
}
};
export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsConfig) => {
const params: Params = {
- body: {},
headers: {},
path: {},
query: {},
};
❯ test/method-class-conflict.test.ts:86:11
❯ test/method-class-conflict.test.ts:83:7
|
Loading