From aab4c5fdaa55a311b2a5cf4ff9c0957613e9dc9e Mon Sep 17 00:00:00 2001 From: Matt Muller Date: Fri, 18 Oct 2024 10:05:44 -0400 Subject: [PATCH] Test with new protocol tests --- .../protocol-tests/input/smithy-rpc-v2-cbor.json | 15 +++++++++++++++ .../spec/protocol_tests_spec_helper.rb | 1 + gems/aws-sdk-core/lib/aws-sdk-core/rpc_v2.rb | 2 ++ 3 files changed, 18 insertions(+) diff --git a/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/smithy-rpc-v2-cbor.json b/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/smithy-rpc-v2-cbor.json index 1ae4671636b..f790704fd34 100644 --- a/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/smithy-rpc-v2-cbor.json +++ b/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/smithy-rpc-v2-cbor.json @@ -35,6 +35,7 @@ "uri": "/service/RpcV2Protocol/operation/EmptyInputOutput", "body": "v/8=", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -76,6 +77,7 @@ "uri": "/service/RpcV2Protocol/operation/NoInputOutput", "body": "", "headers": { + "Accept": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, "forbidHeaders": [ @@ -129,6 +131,7 @@ "uri": "/service/RpcV2Protocol/operation/OptionalInputOutput", "body": "v/8=", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -217,6 +220,7 @@ "uri": "/service/RpcV2Protocol/operation/RecursiveShapes", "body": "v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -359,6 +363,7 @@ "uri": "/service/RpcV2Protocol/operation/RpcV2CborDenseMaps", "body": "oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -394,6 +399,7 @@ "uri": "/service/RpcV2Protocol/operation/RpcV2CborDenseMaps", "body": "om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -430,6 +436,7 @@ "uri": "/service/RpcV2Protocol/operation/RpcV2CborDenseMaps", "body": "oWtkZW5zZVNldE1hcKJheIBheYJhYWFi", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -665,6 +672,7 @@ "uri": "/service/RpcV2Protocol/operation/RpcV2CborLists", "body": "v2pzdHJpbmdMaXN0gmNmb29jYmFyaXN0cmluZ1NldIJjZm9vY2JhcmtpbnRlZ2VyTGlzdIIBAmtib29sZWFuTGlzdIL19G10aW1lc3RhbXBMaXN0gsH7QdTX+/OAAADB+0HU1/vzgAAAaGVudW1MaXN0gmNGb29hMGtpbnRFbnVtTGlzdIIBAnBuZXN0ZWRTdHJpbmdMaXN0goJjZm9vY2JhcoJjYmF6Y3F1eG1zdHJ1Y3R1cmVMaXN0gqJhYWExYWJhMqJhYWEzYWJhNGhibG9iTGlzdIJDZm9vQ2Jhcv8=", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -696,6 +704,7 @@ "uri": "/service/RpcV2Protocol/operation/RpcV2CborLists", "body": "v2pzdHJpbmdMaXN0n///", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -727,6 +736,7 @@ "uri": "/service/RpcV2Protocol/operation/RpcV2CborLists", "body": "oWpzdHJpbmdMaXN0gA==", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -841,6 +851,7 @@ "uri": "/service/RpcV2Protocol/operation/SimpleScalarProperties", "body": "v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -870,6 +881,7 @@ "uri": "/service/RpcV2Protocol/operation/SimpleScalarProperties", "body": "v/8=", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -900,6 +912,7 @@ "uri": "/service/RpcV2Protocol/operation/SimpleScalarProperties", "body": "v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -930,6 +943,7 @@ "uri": "/service/RpcV2Protocol/operation/SimpleScalarProperties", "body": "v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, @@ -960,6 +974,7 @@ "uri": "/service/RpcV2Protocol/operation/SimpleScalarProperties", "body": "v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/", "headers": { + "Accept": "application/cbor", "Content-Type": "application/cbor", "smithy-protocol": "rpc-v2-cbor" }, diff --git a/build_tools/aws-sdk-code-generator/spec/protocol_tests_spec_helper.rb b/build_tools/aws-sdk-code-generator/spec/protocol_tests_spec_helper.rb index 84da256b79e..be6a07a23cf 100644 --- a/build_tools/aws-sdk-code-generator/spec/protocol_tests_spec_helper.rb +++ b/build_tools/aws-sdk-code-generator/spec/protocol_tests_spec_helper.rb @@ -114,6 +114,7 @@ def set_engine(context, protocol, engine) when /xml/, /ec2/, /query/ Aws::Xml::Parser when /smithy-rpc-v2-cbor/ + Aws::RpcV2 # autoload Aws::Cbor else raise "unsupported protocol: #{protocol}" diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/rpc_v2.rb b/gems/aws-sdk-core/lib/aws-sdk-core/rpc_v2.rb index e269c9c5756..db3a16a6f59 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/rpc_v2.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/rpc_v2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'cbor' require_relative 'rpc_v2/handler' require_relative 'rpc_v2/content_type_handler'