@@ -1441,7 +1441,11 @@ export function createClient<K extends ParamKeys>({
14411441 response_decoder: testParameterWithBodyReferenceDefaultDecoder(),
14421442 url: ({}) => \`\${basePath}/test-parameter-with-body-ref\`,
14431443
1444- body: ({ [\\"body\\"]: body }) => JSON.stringify(body),
1444+ body: ({ [\\"body\\"]: body }) =>
1445+ body?.constructor?.name === \\"Readable\\" ||
1446+ body?.constructor?.name === \\"ReadableStream\\"
1447+ ? (body as ReadableStream)
1448+ : JSON.stringify(body),
14451449
14461450 query: () => withoutUndefinedValues({})
14471451 };
@@ -1462,7 +1466,11 @@ export function createClient<K extends ParamKeys>({
14621466 response_decoder: putTestParameterWithBodyReferenceDefaultDecoder(),
14631467 url: ({}) => \`\${basePath}/put-test-parameter-with-body-ref\`,
14641468
1465- body: ({ [\\"body\\"]: body }) => JSON.stringify(body),
1469+ body: ({ [\\"body\\"]: body }) =>
1470+ body?.constructor?.name === \\"Readable\\" ||
1471+ body?.constructor?.name === \\"ReadableStream\\"
1472+ ? (body as ReadableStream)
1473+ : JSON.stringify(body),
14661474
14671475 query: () => withoutUndefinedValues({})
14681476 };
@@ -3309,7 +3317,11 @@ export function createClient<K extends ParamKeys>({
33093317 response_decoder: testParameterWithBodyReferenceDefaultDecoder(),
33103318 url: ({}) => \`\${basePath}/test-parameter-with-body-ref\`,
33113319
3312- body: ({ [\\"body\\"]: body }) => JSON.stringify(body),
3320+ body: ({ [\\"body\\"]: body }) =>
3321+ body?.constructor?.name === \\"Readable\\" ||
3322+ body?.constructor?.name === \\"ReadableStream\\"
3323+ ? (body as ReadableStream)
3324+ : JSON.stringify(body),
33133325
33143326 query: () => withoutUndefinedValues({})
33153327 };
@@ -3330,7 +3342,11 @@ export function createClient<K extends ParamKeys>({
33303342 response_decoder: putTestParameterWithBodyReferenceDefaultDecoder(),
33313343 url: ({}) => \`\${basePath}/put-test-parameter-with-body-ref\`,
33323344
3333- body: ({ [\\"body\\"]: body }) => JSON.stringify(body),
3345+ body: ({ [\\"body\\"]: body }) =>
3346+ body?.constructor?.name === \\"Readable\\" ||
3347+ body?.constructor?.name === \\"ReadableStream\\"
3348+ ? (body as ReadableStream)
3349+ : JSON.stringify(body),
33343350
33353351 query: () => withoutUndefinedValues({})
33363352 };
0 commit comments