diff --git a/build_tools/aws-sdk-code-generator/spec/protocol-tests-ignore-list.json b/build_tools/aws-sdk-code-generator/spec/protocol-tests-ignore-list.json index 06f1010edb6..24ccf9397b4 100644 --- a/build_tools/aws-sdk-code-generator/spec/protocol-tests-ignore-list.json +++ b/build_tools/aws-sdk-code-generator/spec/protocol-tests-ignore-list.json @@ -1,6 +1,11 @@ { "rest-xml" : { - "input" : {}, + "input" : { + "NestedXmlMapWithXmlNameSerializes": { + "description": "Smithy 1.52.0 did not include a fix to this test.", + "engines": ["ox", "nokogiri", "rexml", "libxml", "oga"] + } + }, "output" : { "SimpleScalarPropertiesComplexEscapes": { "description": "OxEngine does not handle all escape cases but other engines supports it", diff --git a/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-json.json b/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-json.json index 4718d3531b9..5325d432279 100644 --- a/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-json.json +++ b/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-json.json @@ -1685,7 +1685,7 @@ }, "documentation": "
This examples adds headers to the input of a request and response by prefix.
" }, - "description": "No prefix headers are serialized because the value is empty", + "description": "No prefix headers are serialized because the value is not present", "params": { "foo": "Foo", "fooMap": {} @@ -1698,6 +1698,35 @@ "X-Foo": "Foo" } } + }, + { + "id": "RestJsonHttpPrefixEmptyHeaders", + "given": { + "name": "HttpPrefixHeaders", + "http": { + "method": "GET", + "requestUri": "/HttpPrefixHeaders", + "responseCode": 200 + }, + "input": { + "shape": "HttpPrefixHeadersInput" + }, + "documentation": "This examples adds headers to the input of a request and response by prefix.
" + }, + "description": "Serialize prefix headers were the value is present but empty", + "params": { + "fooMap": { + "Abc": "" + } + }, + "serialized": { + "method": "GET", + "uri": "/HttpPrefixHeaders", + "body": "", + "headers": { + "X-Foo-Abc": "" + } + } } ] }, @@ -4362,7 +4391,7 @@ }, "documentation": "Null and empty headers are not sent over the wire.
" }, - "description": "Do not send null values, empty strings, or empty lists over the wire in headers", + "description": "Do not send null values, but do send empty strings and empty lists over the wire in headers", "params": { "a": null, "b": "", @@ -4372,10 +4401,12 @@ "method": "GET", "uri": "/NullAndEmptyHeadersClient", "body": "", + "headers": { + "X-B": "", + "X-C": "" + }, "forbidHeaders": [ - "X-A", - "X-B", - "X-C" + "X-A" ] } } diff --git a/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-xml.json b/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-xml.json index 9577b3db84e..9fa4ae78288 100644 --- a/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-xml.json +++ b/build_tools/aws-sdk-code-generator/spec/protocol-tests/input/rest-xml.json @@ -1674,7 +1674,7 @@ }, "documentation": "This examples adds headers to the input of a request and response by prefix.
" }, - "description": "No prefix headers are serialized because the value is empty", + "description": "No prefix headers are serialized because the value is not present", "params": { "foo": "Foo", "fooMap": {} @@ -1687,6 +1687,35 @@ "X-Foo": "Foo" } } + }, + { + "id": "HttpPrefixEmptyHeaders", + "given": { + "name": "HttpPrefixHeaders", + "http": { + "method": "GET", + "requestUri": "/HttpPrefixHeaders", + "responseCode": 200 + }, + "input": { + "shape": "HttpPrefixHeadersInputOutput" + }, + "documentation": "This examples adds headers to the input of a request and response by prefix.
" + }, + "description": "Serialize prefix headers were the value is present but empty", + "params": { + "fooMap": { + "Abc": "" + } + }, + "serialized": { + "method": "GET", + "uri": "/HttpPrefixHeaders", + "body": "", + "headers": { + "X-Foo-Abc": "" + } + } } ] }, @@ -2750,6 +2779,89 @@ } ] }, + { + "description": "Test cases for NestedXmlMapWithXmlName operation", + "metadata": { + "protocol": "rest-xml", + "protocols": [ + "rest-xml" + ], + "apiVersion": "2019-12-16" + }, + "shapes": { + "NestedXmlMapWithXmlNameInputOutput": { + "type": "structure", + "members": { + "nestedXmlMapWithXmlNameMap": { + "shape": "NestedXmlMapWithXmlNameMap" + } + } + }, + "NestedXmlMapWithXmlNameMap": { + "type": "map", + "key": { + "shape": "String", + "locationName": "OuterKey" + }, + "value": { + "shape": "NestedXmlMapWithXmlNameInnerMap" + } + }, + "NestedXmlMapWithXmlNameInnerMap": { + "type": "map", + "key": { + "shape": "String", + "locationName": "InnerKey" + }, + "value": { + "shape": "String", + "locationName": "InnerValue" + } + }, + "String": { + "type": "string" + } + }, + "cases": [ + { + "id": "NestedXmlMapWithXmlNameSerializes", + "given": { + "name": "NestedXmlMapWithXmlName", + "http": { + "method": "POST", + "requestUri": "/NestedXmlMapWithXmlName", + "responseCode": 200 + }, + "input": { + "shape": "NestedXmlMapWithXmlNameInputOutput", + "locationName": "NestedXmlMapWithXmlNameRequest" + }, + "documentation": "Nested Xml Maps with key/values with @xmlName
" + }, + "description": "Serializes nested XML Maps in requests that have xmlName on members", + "params": { + "nestedXmlMapWithXmlNameMap": { + "foo": { + "bar": "Baz", + "fizz": "Buzz" + }, + "qux": { + "foobar": "Bar", + "fizzbuzz": "Buzz" + } + } + }, + "serialized": { + "method": "POST", + "uri": "/NestedXmlMapWithXmlName", + "body": "Null and empty headers are not sent over the wire.
" }, - "description": "Do not send null values, empty strings, or empty lists over the wire in headers", + "description": "Do not send null values, but do send empty strings and empty lists over the wire in headers", "params": { "a": null, "b": "", @@ -2879,10 +2991,12 @@ "method": "GET", "uri": "/NullAndEmptyHeadersClient", "body": "", + "headers": { + "X-B": "", + "X-C": "" + }, "forbidHeaders": [ - "X-A", - "X-B", - "X-C" + "X-A" ] } } 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/output/rest-xml.json b/build_tools/aws-sdk-code-generator/spec/protocol-tests/output/rest-xml.json index 9d2efabd011..fd9ea948175 100644 --- a/build_tools/aws-sdk-code-generator/spec/protocol-tests/output/rest-xml.json +++ b/build_tools/aws-sdk-code-generator/spec/protocol-tests/output/rest-xml.json @@ -1999,6 +1999,87 @@ } ] }, + { + "description": "Test cases for NestedXmlMapWithXmlName operation", + "metadata": { + "protocol": "rest-xml", + "protocols": [ + "rest-xml" + ], + "apiVersion": "2019-12-16" + }, + "shapes": { + "NestedXmlMapWithXmlNameInputOutput": { + "type": "structure", + "members": { + "nestedXmlMapWithXmlNameMap": { + "shape": "NestedXmlMapWithXmlNameMap" + } + } + }, + "NestedXmlMapWithXmlNameMap": { + "type": "map", + "key": { + "shape": "String", + "locationName": "OuterKey" + }, + "value": { + "shape": "NestedXmlMapWithXmlNameInnerMap" + } + }, + "NestedXmlMapWithXmlNameInnerMap": { + "type": "map", + "key": { + "shape": "String", + "locationName": "InnerKey" + }, + "value": { + "shape": "String", + "locationName": "InnerValue" + } + }, + "String": { + "type": "string" + } + }, + "cases": [ + { + "id": "NestedXmlMapWithXmlNameDeserializes", + "given": { + "name": "NestedXmlMapWithXmlName", + "http": { + "method": "POST", + "requestUri": "/NestedXmlMapWithXmlName", + "responseCode": 200 + }, + "output": { + "shape": "NestedXmlMapWithXmlNameInputOutput" + }, + "documentation": "Nested Xml Maps with key/values with @xmlName
" + }, + "description": "Serializes nested XML maps in responses that have xmlName on members", + "result": { + "nestedXmlMapWithXmlNameMap": { + "foo": { + "bar": "Baz", + "fizz": "Buzz" + }, + "qux": { + "foobar": "Bar", + "fizzbuzz": "Buzz" + } + } + }, + "response": { + "status_code": 200, + "headers": { + "Content-Type": "application/xml" + }, + "body": "