From 5d9bb32463fcec88a95f9b9fd23f3474cbe00f67 Mon Sep 17 00:00:00 2001 From: jonathan343 Date: Wed, 8 Jan 2025 15:51:01 -0500 Subject: [PATCH] Update to the latest protocol test models --- tests/unit/protocols/output/json.json | 108 +++++++++++++++++++++ tests/unit/protocols/output/rest-json.json | 22 ++--- tests/unit/protocols/output/rest-xml.json | 97 ++++++++++++++++-- 3 files changed, 208 insertions(+), 19 deletions(-) diff --git a/tests/unit/protocols/output/json.json b/tests/unit/protocols/output/json.json index 8b2ab6a13a..158b3747f4 100644 --- a/tests/unit/protocols/output/json.json +++ b/tests/unit/protocols/output/json.json @@ -732,6 +732,114 @@ } ] }, + { + "description": "Test cases for JsonIntEnums operation", + "metadata": { + "protocol": "json", + "protocols": [ + "json" + ], + "apiVersion": "2018-01-01", + "jsonVersion": "1.1", + "targetPrefix": "JsonProtocol" + }, + "shapes": { + "JsonIntEnumsInputOutput": { + "type": "structure", + "members": { + "intEnum1": { + "shape": "IntegerEnum" + }, + "intEnum2": { + "shape": "IntegerEnum" + }, + "intEnum3": { + "shape": "IntegerEnum" + }, + "intEnumList": { + "shape": "IntegerEnumList" + }, + "intEnumSet": { + "shape": "IntegerEnumSet" + }, + "intEnumMap": { + "shape": "IntegerEnumMap" + } + } + }, + "IntegerEnum": { + "type": "integer", + "box": true + }, + "IntegerEnumList": { + "type": "list", + "member": { + "shape": "IntegerEnum" + } + }, + "IntegerEnumSet": { + "type": "list", + "member": { + "shape": "IntegerEnum" + } + }, + "IntegerEnumMap": { + "type": "map", + "key": { + "shape": "String" + }, + "value": { + "shape": "IntegerEnum" + } + }, + "String": { + "type": "string" + } + }, + "cases": [ + { + "id": "AwsJson11IntEnums", + "given": { + "name": "JsonIntEnums", + "http": { + "method": "POST", + "requestUri": "/" + }, + "output": { + "shape": "JsonIntEnumsInputOutput" + }, + "documentation": "

This example serializes intEnums as top level properties, in lists, sets, and maps.

", + "idempotent": true + }, + "description": "Serializes simple scalar properties", + "result": { + "intEnum1": 1, + "intEnum2": 2, + "intEnum3": 3, + "intEnumList": [ + 1, + 2 + ], + "intEnumSet": [ + 1, + 2 + ], + "intEnumMap": { + "a": 1, + "b": 2 + } + }, + "response": { + "status_code": 200, + "headers": { + "Content-Type": "application/x-amz-json-1.1", + "X-Amz-Target": "JsonProtocol.JsonIntEnums" + }, + "body": "{\n \"intEnum1\": 1,\n \"intEnum2\": 2,\n \"intEnum3\": 3,\n \"intEnumList\": [\n 1,\n 2\n ],\n \"intEnumSet\": [\n 1,\n 2\n ],\n \"intEnumMap\": {\n \"a\": 1,\n \"b\": 2\n }\n}" + } + } + ] + }, { "description": "Test cases for JsonUnions operation", "metadata": { diff --git a/tests/unit/protocols/output/rest-json.json b/tests/unit/protocols/output/rest-json.json index c7e9f46a32..bf69fd944d 100644 --- a/tests/unit/protocols/output/rest-json.json +++ b/tests/unit/protocols/output/rest-json.json @@ -1360,12 +1360,12 @@ "foo": { "shape": "String", "location": "header", - "locationName": "X-Foo" + "locationName": "x-foo" }, "fooMap": { "shape": "StringMap", "location": "headers", - "locationName": "X-Foo-" + "locationName": "x-foo-" } } }, @@ -1401,16 +1401,16 @@ "result": { "foo": "Foo", "fooMap": { - "Abc": "Abc value", - "Def": "Def value" + "abc": "Abc value", + "def": "Def value" } }, "response": { "status_code": 200, "headers": { - "X-Foo": "Foo", - "X-Foo-Abc": "Abc value", - "X-Foo-Def": "Def value" + "x-foo": "Foo", + "x-foo-abc": "Abc value", + "x-foo-def": "Def value" } } } @@ -1467,15 +1467,15 @@ "description": "(de)serializes all response headers", "result": { "prefixHeaders": { - "X-Foo": "Foo", - "Hello": "Hello" + "x-foo": "Foo", + "hello": "Hello" } }, "response": { "status_code": 200, "headers": { - "Hello": "Hello", - "X-Foo": "Foo" + "hello": "Hello", + "x-foo": "Foo" } } } diff --git a/tests/unit/protocols/output/rest-xml.json b/tests/unit/protocols/output/rest-xml.json index 9d2efabd01..c048fedfe8 100644 --- a/tests/unit/protocols/output/rest-xml.json +++ b/tests/unit/protocols/output/rest-xml.json @@ -1214,12 +1214,12 @@ "foo": { "shape": "String", "location": "header", - "locationName": "X-Foo" + "locationName": "x-foo" }, "fooMap": { "shape": "FooPrefixHeaders", "location": "headers", - "locationName": "X-Foo-" + "locationName": "x-foo-" } } }, @@ -1255,16 +1255,16 @@ "result": { "foo": "Foo", "fooMap": { - "Abc": "Abc value", - "Def": "Def value" + "abc": "Abc value", + "def": "Def value" } }, "response": { "status_code": 200, "headers": { - "X-Foo": "Foo", - "X-Foo-Abc": "Abc value", - "X-Foo-Def": "Def value" + "x-foo": "Foo", + "x-foo-abc": "Abc value", + "x-foo-def": "Def value" }, "body": "" } @@ -1291,7 +1291,7 @@ "response": { "status_code": 200, "headers": { - "X-Foo": "Foo" + "x-foo": "Foo" }, "body": "" } @@ -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": " \n \n \n foo\n \n \n bar\n Baz\n \n \n fizz\n Buzz\n \n \n \n \n qux\n \n \n foobar\n Bar\n \n \n fizzbuzz\n Buzz\n \n \n \n \n \n" + } + } + ] + }, { "description": "Test cases for NoInputAndNoOutput operation", "metadata": {