Skip to content

Commit

Permalink
Update to the latest protocol test models
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan343 committed Jan 8, 2025
1 parent 69ec28a commit 5d9bb32
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 19 deletions.
108 changes: 108 additions & 0 deletions tests/unit/protocols/output/json.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "<p>This example serializes intEnums as top level properties, in lists, sets, and maps.</p>",
"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": {
Expand Down
22 changes: 11 additions & 11 deletions tests/unit/protocols/output/rest-json.json
Original file line number Diff line number Diff line change
Expand Up @@ -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-"
}
}
},
Expand Down Expand Up @@ -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"
}
}
}
Expand Down Expand Up @@ -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"
}
}
}
Expand Down
97 changes: 89 additions & 8 deletions tests/unit/protocols/output/rest-xml.json
Original file line number Diff line number Diff line change
Expand Up @@ -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-"
}
}
},
Expand Down Expand Up @@ -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": ""
}
Expand All @@ -1291,7 +1291,7 @@
"response": {
"status_code": 200,
"headers": {
"X-Foo": "Foo"
"x-foo": "Foo"
},
"body": ""
}
Expand Down Expand Up @@ -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": "<p>Nested Xml Maps with key/values with @xmlName</p>"
},
"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": " <NestedXmlMapWithXmlNameInputOutput>\n <nestedXmlMapWithXmlNameMap>\n <entry>\n <OuterKey>foo</OuterKey>\n <value>\n <entry>\n <InnerKey>bar</InnerKey>\n <InnerValue>Baz</InnerValue>\n </entry>\n <entry>\n <InnerKey>fizz</InnerKey>\n <InnerValue>Buzz</InnerValue>\n </entry>\n </value>\n </entry>\n <entry>\n <OuterKey>qux</OuterKey>\n <value>\n <entry>\n <InnerKey>foobar</InnerKey>\n <InnerValue>Bar</InnerValue>\n </entry>\n <entry>\n <InnerKey>fizzbuzz</InnerKey>\n <InnerValue>Buzz</InnerValue>\n </entry>\n </value>\n </entry>\n </nestedXmlMapWithXmlNameMap>\n </NestedXmlMapWithXmlNameInputOutput>\n"
}
}
]
},
{
"description": "Test cases for NoInputAndNoOutput operation",
"metadata": {
Expand Down

0 comments on commit 5d9bb32

Please sign in to comment.