diff --git a/clients/client-s3/src/commands/DeleteObjectCommand.ts b/clients/client-s3/src/commands/DeleteObjectCommand.ts index 60bee70a7e66..6f938a15d5d5 100644 --- a/clients/client-s3/src/commands/DeleteObjectCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectCommand.ts @@ -154,28 +154,28 @@ export interface DeleteObjectCommandOutput extends DeleteObjectOutput, __Metadat *

Base exception class for all service exceptions from S3 service.

* * @public - * @example To delete an object + * @example To delete an object (from a non-versioned bucket) * ```javascript - * // The following example deletes an object from an S3 bucket. + * // The following example deletes an object from a non-versioned bucket. * const input = { - * "Bucket": "examplebucket", - * "Key": "objectkey.jpg" + * "Bucket": "ExampleBucket", + * "Key": "HappyFace.jpg" * }; * const command = new DeleteObjectCommand(input); * await client.send(command); - * // example id: to-delete-an-object-1472850136595 + * // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089 * ``` * - * @example To delete an object (from a non-versioned bucket) + * @example To delete an object * ```javascript - * // The following example deletes an object from a non-versioned bucket. + * // The following example deletes an object from an S3 bucket. * const input = { - * "Bucket": "ExampleBucket", - * "Key": "HappyFace.jpg" + * "Bucket": "examplebucket", + * "Key": "objectkey.jpg" * }; * const command = new DeleteObjectCommand(input); * await client.send(command); - * // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089 + * // example id: to-delete-an-object-1472850136595 * ``` * */ diff --git a/clients/client-s3/src/commands/GetObjectTaggingCommand.ts b/clients/client-s3/src/commands/GetObjectTaggingCommand.ts index 32326f4bc9dc..7d84170e5e3f 100644 --- a/clients/client-s3/src/commands/GetObjectTaggingCommand.ts +++ b/clients/client-s3/src/commands/GetObjectTaggingCommand.ts @@ -98,12 +98,13 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _ *

Base exception class for all service exceptions from S3 service.

* * @public - * @example To retrieve tag set of an object + * @example To retrieve tag set of a specific object version * ```javascript - * // The following example retrieves tag set of an object. + * // The following example retrieves tag set of an object. The request specifies object version. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "exampleobject", + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * }; * const command = new GetObjectTaggingCommand(input); * const response = await client.send(command); @@ -111,27 +112,22 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _ * { * "TagSet": [ * { - * "Key": "Key4", - * "Value": "Value4" - * }, - * { - * "Key": "Key3", - * "Value": "Value3" + * "Key": "Key1", + * "Value": "Value1" * } * ], - * "VersionId": "null" + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * } * *\/ - * // example id: to-retrieve-tag-set-of-an-object-1481833847896 + * // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663 * ``` * - * @example To retrieve tag set of a specific object version + * @example To retrieve tag set of an object * ```javascript - * // The following example retrieves tag set of an object. The request specifies object version. + * // The following example retrieves tag set of an object. * const input = { * "Bucket": "examplebucket", - * "Key": "exampleobject", - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "Key": "HappyFace.jpg" * }; * const command = new GetObjectTaggingCommand(input); * const response = await client.send(command); @@ -139,14 +135,18 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _ * { * "TagSet": [ * { - * "Key": "Key1", - * "Value": "Value1" + * "Key": "Key4", + * "Value": "Value4" + * }, + * { + * "Key": "Key3", + * "Value": "Value3" * } * ], - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "VersionId": "null" * } * *\/ - * // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663 + * // example id: to-retrieve-tag-set-of-an-object-1481833847896 * ``` * */ diff --git a/clients/client-s3/src/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts index 92410019d42b..1b3708e7c6c5 100644 --- a/clients/client-s3/src/commands/PutObjectCommand.ts +++ b/clients/client-s3/src/commands/PutObjectCommand.ts @@ -249,43 +249,46 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare *

Base exception class for all service exceptions from S3 service.

* * @public - * @example To upload an object and specify canned ACL. + * @example To create an object. * ```javascript - * // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { - * "ACL": "authenticated-read", * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "exampleobject" + * "Key": "objectkey" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr" + * "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ" * } * *\/ - * // example id: to-upload-an-object-and-specify-canned-acl-1483397779571 + * // example id: to-create-an-object-1483147613675 * ``` * - * @example To create an object. + * @example To upload object and specify user-defined metadata * ```javascript - * // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "objectkey" + * "Key": "exampleobject", + * "Metadata": { + * "metadata1": "value1", + * "metadata2": "value2" + * } * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ" + * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" * } * *\/ - * // example id: to-create-an-object-1483147613675 + * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 * ``` * * @example To upload an object @@ -307,35 +310,35 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * // example id: to-upload-an-object-1481760101010 * ``` * - * @example To upload an object and specify optional tags + * @example To upload an object and specify canned ACL. * ```javascript - * // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object. + * // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { - * "Body": "c:\\HappyFace.jpg", + * "ACL": "authenticated-read", + * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "Tagging": "key1=value1&key2=value2" + * "Key": "exampleobject" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a" + * "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr" * } * *\/ - * // example id: to-upload-an-object-and-specify-optional-tags-1481762310955 + * // example id: to-upload-an-object-and-specify-canned-acl-1483397779571 * ``` * - * @example To upload an object and specify server-side encryption and object tags + * @example To upload an object (specify optional headers) * ```javascript - * // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. * const input = { - * "Body": "filetoupload", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "exampleobject", + * "Key": "HappyFace.jpg", * "ServerSideEncryption": "AES256", - * "Tagging": "key1=value1&key2=value2" + * "StorageClass": "STANDARD_IA" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); @@ -343,55 +346,52 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", * "ServerSideEncryption": "AES256", - * "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt" + * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" * } * *\/ - * // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831 + * // example id: to-upload-an-object-(specify-optional-headers) * ``` * - * @example To upload an object (specify optional headers) + * @example To upload an object and specify optional tags * ```javascript - * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. + * // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object. * const input = { - * "Body": "HappyFace.jpg", + * "Body": "c:\\HappyFace.jpg", * "Bucket": "examplebucket", * "Key": "HappyFace.jpg", - * "ServerSideEncryption": "AES256", - * "StorageClass": "STANDARD_IA" + * "Tagging": "key1=value1&key2=value2" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "ServerSideEncryption": "AES256", - * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" + * "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a" * } * *\/ - * // example id: to-upload-an-object-(specify-optional-headers) + * // example id: to-upload-an-object-and-specify-optional-tags-1481762310955 * ``` * - * @example To upload object and specify user-defined metadata + * @example To upload an object and specify server-side encryption and object tags * ```javascript - * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { * "Body": "filetoupload", * "Bucket": "examplebucket", * "Key": "exampleobject", - * "Metadata": { - * "metadata1": "value1", - * "metadata2": "value2" - * } + * "ServerSideEncryption": "AES256", + * "Tagging": "key1=value1&key2=value2" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" + * "ServerSideEncryption": "AES256", + * "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt" * } * *\/ - * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 + * // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831 * ``` * */ diff --git a/clients/client-s3/src/commands/UploadPartCopyCommand.ts b/clients/client-s3/src/commands/UploadPartCopyCommand.ts index a330ba4d28b9..3ea96249be70 100644 --- a/clients/client-s3/src/commands/UploadPartCopyCommand.ts +++ b/clients/client-s3/src/commands/UploadPartCopyCommand.ts @@ -305,14 +305,15 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met *

Base exception class for all service exceptions from S3 service.

* * @public - * @example To upload a part by copying data from an existing object as data source + * @example To upload a part by copying byte range from an existing object as data source * ```javascript - * // The following example uploads a part of a multipart upload by copying data from an existing object as data source. + * // The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source. * const input = { * "Bucket": "examplebucket", * "CopySource": "/bucketname/sourceobjectkey", + * "CopySourceRange": "bytes=1-100000", * "Key": "examplelargeobject", - * "PartNumber": "1", + * "PartNumber": "2", * "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--" * }; * const command = new UploadPartCopyCommand(input); @@ -320,23 +321,22 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met * /* response == * { * "CopyPartResult": { - * "ETag": "\"b0c6f0e7e054ab8fa2536a2677f8734d\"", - * "LastModified": "2016-12-29T21:24:43.000Z" + * "ETag": "\"65d16d19e65a7508a51f043180edcc36\"", + * "LastModified": "2016-12-29T21:44:28.000Z" * } * } * *\/ - * // example id: to-upload-a-part-by-copying-data-from-an-existing-object-as-data-source-1483046746348 + * // example id: to-upload-a-part-by-copying-byte-range-from-an-existing-object-as-data-source-1483048068594 * ``` * - * @example To upload a part by copying byte range from an existing object as data source + * @example To upload a part by copying data from an existing object as data source * ```javascript - * // The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source. + * // The following example uploads a part of a multipart upload by copying data from an existing object as data source. * const input = { * "Bucket": "examplebucket", * "CopySource": "/bucketname/sourceobjectkey", - * "CopySourceRange": "bytes=1-100000", * "Key": "examplelargeobject", - * "PartNumber": "2", + * "PartNumber": "1", * "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--" * }; * const command = new UploadPartCopyCommand(input); @@ -344,12 +344,12 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met * /* response == * { * "CopyPartResult": { - * "ETag": "\"65d16d19e65a7508a51f043180edcc36\"", - * "LastModified": "2016-12-29T21:44:28.000Z" + * "ETag": "\"b0c6f0e7e054ab8fa2536a2677f8734d\"", + * "LastModified": "2016-12-29T21:24:43.000Z" * } * } * *\/ - * // example id: to-upload-a-part-by-copying-byte-range-from-an-existing-object-as-data-source-1483048068594 + * // example id: to-upload-a-part-by-copying-data-from-an-existing-object-as-data-source-1483046746348 * ``` * */ diff --git a/codegen/gradle.properties b/codegen/gradle.properties index d98db7dc4acb..4e208b07effa 100644 --- a/codegen/gradle.properties +++ b/codegen/gradle.properties @@ -1,2 +1,2 @@ -smithyVersion=1.51.0 +smithyVersion=1.52.0 smithyGradleVersion=0.6.0 diff --git a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts index 5deab5de6b28..71ec51800e3d 100644 --- a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts +++ b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts @@ -2833,7 +2833,7 @@ it("RestJsonHttpPrefixHeadersArePresent:Request", async () => { }); /** - * No prefix headers are serialized because the value is empty + * No prefix headers are serialized because the value is not present */ it("RestJsonHttpPrefixHeadersAreNotPresent:Request", async () => { const client = new RestJsonProtocolClient({ @@ -2865,6 +2865,40 @@ it("RestJsonHttpPrefixHeadersAreNotPresent:Request", async () => { } }); +/** + * Serialize prefix headers were the value is present but empty + */ +it("RestJsonHttpPrefixEmptyHeaders:Request", async () => { + const client = new RestJsonProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + fooMap: { + Abc: "", + } as any, + } as any); + try { + await client.send(command); + fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown"); + return; + } catch (err) { + if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) { + fail(err); + return; + } + const r = err.request; + expect(r.method).toBe("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo-abc"]).toBeDefined(); + expect(r.headers["x-foo-abc"]).toBe(""); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + /** * Adds headers by prefix */ diff --git a/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts b/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts index 1af7f8751c6d..356b2d6f8e62 100644 --- a/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts +++ b/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts @@ -2305,7 +2305,7 @@ it("HttpPrefixHeadersArePresent:Request", async () => { }); /** - * No prefix headers are serialized because the value is empty + * No prefix headers are serialized because the value is not present */ it("HttpPrefixHeadersAreNotPresent:Request", async () => { const client = new RestXmlProtocolClient({ @@ -2337,6 +2337,40 @@ it("HttpPrefixHeadersAreNotPresent:Request", async () => { } }); +/** + * Serialize prefix headers were the value is present but empty + */ +it("HttpPrefixEmptyHeaders:Request", async () => { + const client = new RestXmlProtocolClient({ + ...clientParams, + requestHandler: new RequestSerializationTestHandler(), + }); + + const command = new HttpPrefixHeadersCommand({ + fooMap: { + Abc: "", + } as any, + } as any); + try { + await client.send(command); + fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown"); + return; + } catch (err) { + if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) { + fail(err); + return; + } + const r = err.request; + expect(r.method).toBe("GET"); + expect(r.path).toBe("/HttpPrefixHeaders"); + + expect(r.headers["x-foo-abc"]).toBeDefined(); + expect(r.headers["x-foo-abc"]).toBe(""); + + expect(!r.body || r.body === `{}`).toBeTruthy(); + } +}); + /** * Adds headers by prefix */ diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts b/private/aws-protocoltests-smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts index fbad324954d3..d77f4b991b40 100644 --- a/private/aws-protocoltests-smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts +++ b/private/aws-protocoltests-smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts @@ -1229,4 +1229,5 @@ const throwDefaultError = withBaseException(__BaseException); const SHARED_HEADERS: __HeaderBag = { "content-type": "application/cbor", "smithy-protocol": "rpc-v2-cbor", + accept: "application/cbor", }; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts b/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts index 74f2fd2367fb..cb2fb1599e3b 100644 --- a/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts +++ b/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts @@ -240,6 +240,8 @@ it("empty_input:Request", async () => { expect(r.headers["x-amz-target"]).toBeUndefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -695,6 +697,8 @@ it("no_input:Request", async () => { expect(r.headers["content-type"]).toBeUndefined(); expect(r.headers["x-amz-target"]).toBeUndefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); @@ -818,6 +822,8 @@ it.skip("RpcV2CborClientPopulatesDefaultValuesInInput:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -854,6 +860,8 @@ it.skip("RpcV2CborClientSkipsTopLevelDefaultValuesInInput:Request", async () => expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -918,6 +926,8 @@ it.skip("RpcV2CborClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -957,6 +967,8 @@ it.skip("RpcV2CborClientUsesExplicitlyProvidedValuesInTopLevel:Request", async ( expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -995,6 +1007,8 @@ it.skip("RpcV2CborClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Re expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1156,6 +1170,8 @@ it("optional_input:Request", async () => { expect(r.headers["x-amz-target"]).toBeUndefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1235,6 +1251,8 @@ it("RpcV2CborRecursiveShapes:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RecursiveShapes"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1380,6 +1398,8 @@ it("RpcV2CborMaps:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1423,6 +1443,8 @@ it("RpcV2CborSerializesZeroValuesInMaps:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1464,6 +1486,8 @@ it("RpcV2CborSerializesDenseSetMap:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1698,6 +1722,8 @@ it("RpcV2CborLists:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborLists"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1736,6 +1762,8 @@ it("RpcV2CborListsEmpty:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborLists"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -1774,6 +1802,8 @@ it("RpcV2CborListsEmptyUsingDefiniteLength:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborLists"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2004,6 +2034,8 @@ it("RpcV2CborSparseMaps:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2053,6 +2085,8 @@ it("RpcV2CborSerializesNullMapValues:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2094,6 +2128,8 @@ it("RpcV2CborSerializesSparseSetMap:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2136,6 +2172,8 @@ it("RpcV2CborSerializesSparseSetMapAndRetainsNull:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2179,6 +2217,8 @@ it("RpcV2CborSerializesZeroValuesInSparseMaps:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2451,6 +2491,8 @@ it("RpcV2CborSimpleScalarProperties:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2489,6 +2531,8 @@ it("RpcV2CborClientDoesntSerializeNullStructureValues:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2528,6 +2572,8 @@ it("RpcV2CborSupportsNaNFloatInputs:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2567,6 +2613,8 @@ it("RpcV2CborSupportsInfinityFloatInputs:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2606,6 +2654,8 @@ it("RpcV2CborSupportsNegativeInfinityFloatInputs:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -2983,6 +3033,8 @@ it("RpcV2CborSparseMapsSerializeNullValues:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/SparseNullsOperation"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); @@ -3021,6 +3073,8 @@ it("RpcV2CborSparseListsSerializeNull:Request", async () => { expect(r.path).toBe("/service/RpcV2Protocol/operation/SparseNullsOperation"); expect(r.headers["content-length"]).toBeDefined(); + expect(r.headers["accept"]).toBeDefined(); + expect(r.headers["accept"]).toBe("application/cbor"); expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); expect(r.headers["smithy-protocol"]).toBeDefined(); diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index bb27491a11a6..f1a9ca3463bc 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -1,7 +1,7 @@ // Update this commit when taking up new changes from smithy-typescript. module.exports = { // Use full commit hash as we explicitly fetch it. - SMITHY_TS_COMMIT: "98d74245c48bc5cf0153112d1dbaa1fcde4139df", + SMITHY_TS_COMMIT: "140751e77d414e45d9100a5698744b08fc9a21fa", }; if (module.exports.SMITHY_TS_COMMIT.length < 40) {