autorest.typescript icon indicating copy to clipboard operation
autorest.typescript copied to clipboard

The binary type is not workable with the latest @azure-rest/core-client version

Open MaryGao opened this issue 2 years ago • 0 comments

We have RLC integration testing for binary type : https://github.com/Azure/autorest.typescript/blob/main/packages/autorest.typescript/test/rlcIntegration/bodyFormDataRest.spec.ts.

However if we upgrade @azure-rest/core-client to the latest GA or dev one we will meet below issue:

TSError: ⨯ Unable to compile TypeScript:
test/rlcIntegration/bodyFormDataRest.spec.ts(31,7): error TS2345: Argument of type '{ contentType: "multipart/form-data"; body: { fileContent: Uint8Array; fileName: string; }; binaryResponse: boolean; }' is not assignable to parameter of type 'UploadFileParameters'.
  Object literal may only specify known properties, and 'binaryResponse' does not exist in type 'UploadFileParameters'.
test/rlcIntegration/bodyFormDataRest.spec.ts(63,7): error TS2345: Argument of type '{ body: Uint8Array; binaryResponse: boolean; contentType: "application/octet-stream"; }' is not assignable to parameter of type 'UploadFileViaBodyParameters'.
  Object literal may only specify known properties, and 'binaryResponse' does not exist in type 'UploadFileViaBodyParameters'.

    at createTSError (/Users/runner/work/1/s/common/temp/node_modules/.pnpm/[email protected]_bea9319c18027313ff9f3aa6f8c8e70e/node_modules/ts-node/src/index.ts:859:12)

MaryGao avatar Aug 08 '22 06:08 MaryGao