diff --git a/smithy-aws-protocol-tests/model/ec2-query/input-lists.smithy b/smithy-aws-protocol-tests/model/ec2-query/input-lists.smithy index 43b4bb63d1f..6d0588cb9a7 100644 --- a/smithy-aws-protocol-tests/model/ec2-query/input-lists.smithy +++ b/smithy-aws-protocol-tests/model/ec2-query/input-lists.smithy @@ -31,8 +31,8 @@ apply QueryLists @httpRequestTests([ &ListArg.1=foo &ListArg.2=bar &ListArg.3=baz - &ComplexListArg.1.hi=hello - &ComplexListArg.2.hi=hola""", + &ComplexListArg.1.Hi=hello + &ComplexListArg.2.Hi=hola""", bodyMediaType: "application/x-www-form-urlencoded", params: { ListArg: ["foo", "bar", "baz"], diff --git a/smithy-aws-protocol-tests/model/ec2-query/input.smithy b/smithy-aws-protocol-tests/model/ec2-query/input.smithy index a583f3ee7e7..6b3045d181b 100644 --- a/smithy-aws-protocol-tests/model/ec2-query/input.smithy +++ b/smithy-aws-protocol-tests/model/ec2-query/input.smithy @@ -243,9 +243,9 @@ apply QueryTimestamps @httpRequestTests([ body: """ Action=QueryTimestamps &Version=2020-01-08 - &normalFormat=2015-01-25T08%3A00%3A00Z - &epochMember=1422172800 - &epochTarget=1422172800""", + &NormalFormat=2015-01-25T08%3A00%3A00Z + &EpochMember=1422172800 + &EpochTarget=1422172800""", bodyMediaType: "application/x-www-form-urlencoded", params: { normalFormat: 1422172800, @@ -330,9 +330,9 @@ apply QueryIdempotencyTokenAutoFill @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=NestedStructures + Action=QueryIdempotencyTokenAutoFill &Version=2020-01-08 - &token=00000000-0000-4000-8000-000000000000""", + &Token=00000000-0000-4000-8000-000000000000""", bodyMediaType: "application/x-www-form-urlencoded", }, { @@ -345,9 +345,9 @@ apply QueryIdempotencyTokenAutoFill @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=NestedStructures + Action=QueryIdempotencyTokenAutoFill &Version=2020-01-08 - &token=00000000-0000-4000-8000-000000000123""", + &Token=00000000-0000-4000-8000-000000000123""", bodyMediaType: "application/x-www-form-urlencoded", params: { token: "00000000-0000-4000-8000-000000000123" diff --git a/smithy-aws-protocol-tests/model/ec2-query/main.smithy b/smithy-aws-protocol-tests/model/ec2-query/main.smithy index 61db174a14b..b5793e47fff 100644 --- a/smithy-aws-protocol-tests/model/ec2-query/main.smithy +++ b/smithy-aws-protocol-tests/model/ec2-query/main.smithy @@ -28,10 +28,12 @@ $version: "0.5.0" namespace aws.protocols.tests.ec2 +use aws.api#service use smithy.test#httpRequestTests use smithy.test#httpResponseTests /// An EC2 query service that sends query requests and XML responses. +@service(sdkId: "EC2 Protocol") @protocols([{"name": "aws.ec2"}]) @xmlNamespace(uri: "https://example.com/") service AwsEc2 { diff --git a/smithy-aws-protocol-tests/model/ec2-query/xml-lists.smithy b/smithy-aws-protocol-tests/model/ec2-query/xml-lists.smithy index 5bac8533b6e..3cafd3d5ea2 100644 --- a/smithy-aws-protocol-tests/model/ec2-query/xml-lists.smithy +++ b/smithy-aws-protocol-tests/model/ec2-query/xml-lists.smithy @@ -68,7 +68,7 @@ apply XmlLists @httpResponseTests([ baz qux - + foo bar diff --git a/smithy-aws-protocol-tests/model/json-rpc-1-1/main.json b/smithy-aws-protocol-tests/model/json-rpc-1-1/main.json index 8fbb24d3ed1..89d56a7e36e 100644 --- a/smithy-aws-protocol-tests/model/json-rpc-1-1/main.json +++ b/smithy-aws-protocol-tests/model/json-rpc-1-1/main.json @@ -59,7 +59,7 @@ "params": {}, "headers": { "Content-Type": "application/x-amz-json-1.1", - "X-Amz-Target": "JsonProtocolService.OperationWithOptionalInputOutput" + "X-Amz-Target": "JsonProtocol.EmptyOperation" } } ], @@ -72,7 +72,6 @@ "headers": { "Content-Type": "application/x-amz-json-1.1" }, - "requireHeaders": ["Content-Length"], "bodyMediaType": "application/json", "body": "{}", "params": {} @@ -522,7 +521,7 @@ "MapOfStrings": {} }, "bodyMediaType": "application/json", - "body": "{\"MapOfStrings\":[]}" + "body": "{\"MapOfStrings\":{}}" }, { "id": "serializes_map_of_list_shapes", @@ -626,7 +625,7 @@ "SimpleStruct": {} }, "bodyMediaType": "application/json", - "body": "{\"SimpleStruct\":[]}" + "body": "{\"SimpleStruct\":{}}" }, { "id": "serializes_structure_which_have_no_members", @@ -638,7 +637,7 @@ "EmptyStruct": {} }, "bodyMediaType": "application/json", - "body": "{\"EmptyStruct\":[]}" + "body": "{\"EmptyStruct\":{}}" }, { "id": "serializes_recursive_structure_shapes", @@ -1000,7 +999,9 @@ "code": 200, "headers": { "X-Amzn-Requestid": "amazon-uniq-request-id" - } + }, + "bodyMediaType": "application/json", + "body": "{}" } ] } @@ -1101,7 +1102,7 @@ "uri": "/", "headers": { "Content-Type": "application/x-amz-json-1.1", - "X-Amz-Target": "JsonProtocolService.OperationWithOptionalInputOutput" + "X-Amz-Target": "JsonProtocol.OperationWithOptionalInputOutput" }, "bodyMediaType": "application/json", "body": "{}" @@ -1117,9 +1118,8 @@ }, "headers": { "Content-Type": "application/x-amz-json-1.1", - "X-Amz-Target": "JsonProtocolService.OperationWithOptionalInputOutput" + "X-Amz-Target": "JsonProtocol.OperationWithOptionalInputOutput" }, - "requireHeaders": ["Content-Length"], "bodyMediaType": "application/json", "body": "{\"Value\":\"Hi\"}" } diff --git a/smithy-aws-protocol-tests/model/query/input-maps.smithy b/smithy-aws-protocol-tests/model/query/input-maps.smithy index abf2374f57a..048e62583bb 100644 --- a/smithy-aws-protocol-tests/model/query/input-maps.smithy +++ b/smithy-aws-protocol-tests/model/query/input-maps.smithy @@ -25,7 +25,7 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08 &MapArg.entry.1.key=foo &MapArg.entry.1.value=Foo @@ -49,7 +49,7 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08 &Foo.entry.1.key=foo &Foo.entry.1.value=Foo""", @@ -70,7 +70,7 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08 &ComplexMapArg.entry.1.key=foo &ComplexMapArg.entry.1.value.hi=Foo @@ -98,7 +98,7 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08""", bodyMediaType: "application/x-www-form-urlencoded", params: { @@ -115,12 +115,12 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08 &MapWithXmlMemberName.entry.1.K=foo &MapWithXmlMemberName.entry.1.V=Foo - &MapWithXmlMemberName.entry.1.K=bar - &MapWithXmlMemberName.entry.1.V=Bar""", + &MapWithXmlMemberName.entry.2.K=bar + &MapWithXmlMemberName.entry.2.V=Bar""", bodyMediaType: "application/x-www-form-urlencoded", params: { MapWithXmlMemberName: { @@ -139,12 +139,12 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08 &FlattenedMap.1.key=foo &FlattenedMap.1.value=Foo - &FlattenedMap.1.key=bar - &FlattenedMap.1.value=Bar""", + &FlattenedMap.2.key=bar + &FlattenedMap.2.value=Bar""", bodyMediaType: "application/x-www-form-urlencoded", params: { FlattenedMap: { @@ -163,7 +163,7 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08 &Hi.1.K=foo &Hi.1.V=Foo @@ -187,12 +187,14 @@ apply QueryMaps @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=QueryLists + Action=QueryMaps &Version=2020-01-08 - &MapOfLists.entry.1.key.1=A - &MapOfLists.entry.1.key.2=B - &MapOfLists.entry.2.key.1=C - &MapOfLists.entry.2.key.2=D""", + &MapOfLists.entry.1.key=foo + &MapOfLists.entry.1.value.member.1=A + &MapOfLists.entry.1.value.member.2=B + &MapOfLists.entry.2.key=bar + &MapOfLists.entry.2.value.member.1=C + &MapOfLists.entry.2.value.member.2=D""", bodyMediaType: "application/x-www-form-urlencoded", params: { MapOfLists: { diff --git a/smithy-aws-protocol-tests/model/query/input.smithy b/smithy-aws-protocol-tests/model/query/input.smithy index d86913c6ffc..cb9e0244a8c 100644 --- a/smithy-aws-protocol-tests/model/query/input.smithy +++ b/smithy-aws-protocol-tests/model/query/input.smithy @@ -265,7 +265,7 @@ apply QueryIdempotencyTokenAutoFill @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=NestedStructures + Action=QueryIdempotencyTokenAutoFill &Version=2020-01-08 &token=00000000-0000-4000-8000-000000000000""", bodyMediaType: "application/x-www-form-urlencoded", @@ -280,7 +280,7 @@ apply QueryIdempotencyTokenAutoFill @httpRequestTests([ "Content-Type": "application/x-www-form-urlencoded" }, body: """ - Action=NestedStructures + Action=QueryIdempotencyTokenAutoFill &Version=2020-01-08 &token=00000000-0000-4000-8000-000000000123""", bodyMediaType: "application/x-www-form-urlencoded", diff --git a/smithy-aws-protocol-tests/model/query/main.smithy b/smithy-aws-protocol-tests/model/query/main.smithy index 99765f77234..822f143bc28 100644 --- a/smithy-aws-protocol-tests/model/query/main.smithy +++ b/smithy-aws-protocol-tests/model/query/main.smithy @@ -2,10 +2,12 @@ $version: "0.5.0" namespace aws.protocols.tests.query +use aws.api#service use smithy.test#httpRequestTests use smithy.test#httpResponseTests /// A query service that sends query requests and XML responses. +@service(sdkId: "Query Protocol") @protocols([{"name": "aws.query"}]) @xmlNamespace(uri: "https://example.com/") service AwsQuery { diff --git a/smithy-aws-protocol-tests/model/query/xml-lists.smithy b/smithy-aws-protocol-tests/model/query/xml-lists.smithy index cb2d8b00874..2f06c6c5587 100644 --- a/smithy-aws-protocol-tests/model/query/xml-lists.smithy +++ b/smithy-aws-protocol-tests/model/query/xml-lists.smithy @@ -69,7 +69,7 @@ apply XmlLists @httpResponseTests([ baz qux - + foo bar diff --git a/smithy-aws-protocol-tests/model/query/xml-maps.smithy b/smithy-aws-protocol-tests/model/query/xml-maps.smithy index c9ba9c3aa9a..dba7ddb133c 100644 --- a/smithy-aws-protocol-tests/model/query/xml-maps.smithy +++ b/smithy-aws-protocol-tests/model/query/xml-maps.smithy @@ -81,13 +81,13 @@ apply XmlMapsXmlName @httpResponseTests([ - foo + foo there - baz + baz bye diff --git a/smithy-aws-protocol-tests/model/query/xml-structs.smithy b/smithy-aws-protocol-tests/model/query/xml-structs.smithy index 44eb34972a8..8a0b7636abd 100644 --- a/smithy-aws-protocol-tests/model/query/xml-structs.smithy +++ b/smithy-aws-protocol-tests/model/query/xml-structs.smithy @@ -119,9 +119,9 @@ apply XmlTimestamps @httpResponseTests([ code: 200, body: """ - + 2014-04-29T18:30:38Z - + """, bodyMediaType: "application/xml", @@ -139,9 +139,9 @@ apply XmlTimestamps @httpResponseTests([ code: 200, body: """ - + 2014-04-29T18:30:38Z - + """, bodyMediaType: "application/xml", @@ -159,9 +159,9 @@ apply XmlTimestamps @httpResponseTests([ code: 200, body: """ - + 1398796238 - + """, bodyMediaType: "application/xml", @@ -179,9 +179,9 @@ apply XmlTimestamps @httpResponseTests([ code: 200, body: """ - + Tue, 29 Apr 2014 18:30:38 GMT - + """, bodyMediaType: "application/xml", diff --git a/smithy-aws-protocol-tests/model/rest-json/empty-input-output.smithy b/smithy-aws-protocol-tests/model/rest-json/empty-input-output.smithy index 0bb532dd38f..9b0c0f61b0c 100644 --- a/smithy-aws-protocol-tests/model/rest-json/empty-input-output.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/empty-input-output.smithy @@ -22,7 +22,7 @@ apply NoInputAndNoOutput @httpRequestTests([ documentation: "No input serializes no payload", protocol: "aws.rest-json-1.1", method: "POST", - uri: "/NoInputAndOutput" + uri: "/NoInputAndNoOutput" } ]) @@ -50,7 +50,7 @@ apply NoInputAndOutput @httpRequestTests([ documentation: "No input serializes no payload", protocol: "aws.rest-json-1.1", method: "POST", - uri: "/NoInputAndOutput" + uri: "/NoInputAndOutputOutput" } ]) diff --git a/smithy-aws-protocol-tests/model/rest-json/errors.smithy b/smithy-aws-protocol-tests/model/rest-json/errors.smithy index 25bf2cb8a25..9bfa6a5b7a4 100644 --- a/smithy-aws-protocol-tests/model/rest-json/errors.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/errors.smithy @@ -125,7 +125,8 @@ apply ComplexError @httpResponseTests([ params: {}, code: 403, headers: { - "Content-Type": "application/json" + "Content-Type": "application/json", + "X-Amzn-Errortype": "ComplexError" }, body: "{}", bodyMediaType: "application/json", diff --git a/smithy-aws-protocol-tests/model/rest-json/http-headers.smithy b/smithy-aws-protocol-tests/model/rest-json/http-headers.smithy index 05273862a08..4c817c71c91 100644 --- a/smithy-aws-protocol-tests/model/rest-json/http-headers.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/http-headers.smithy @@ -6,6 +6,7 @@ $version: "0.5.0" namespace aws.protocols.tests.restjson use aws.protocols.tests.shared#BooleanList +use aws.protocols.tests.shared#DateTime use aws.protocols.tests.shared#EpochSeconds use aws.protocols.tests.shared#FooEnum use aws.protocols.tests.shared#FooEnumList @@ -57,7 +58,7 @@ apply InputAndOutputWithHeaders @httpRequestTests([ "X-Long": "123", "X-Float": "1.0", "X-Double": "1.0", - "X-HeaderIntegerList": "1, 2, 3", + "X-IntegerList": "1, 2, 3", }, body: "", params: { @@ -79,12 +80,12 @@ apply InputAndOutputWithHeaders @httpRequestTests([ headers: { "X-Boolean1": "true", "X-Boolean2": "false", - "X-HeaderBooleanList": "true, false, true" + "X-BooleanList": "true, false, true" }, body: "", params: { headerTrueBool: true, - headerFalseBool: true, + headerFalseBool: false, headerBooleanList: [true, false, true] } }, @@ -95,7 +96,7 @@ apply InputAndOutputWithHeaders @httpRequestTests([ method: "POST", uri: "/InputAndOutputWithHeaders", headers: { - "X-HeaderTimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" + "X-TimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" }, body: "", params: { @@ -110,7 +111,7 @@ apply InputAndOutputWithHeaders @httpRequestTests([ uri: "/InputAndOutputWithHeaders", headers: { "X-Enum": "Foo", - "X-EnumList": "Foo, Baz, Bar" + "X-EnumList": "Foo, Bar, Baz" }, body: "", params: { @@ -150,7 +151,7 @@ apply InputAndOutputWithHeaders @httpResponseTests([ "X-Long": "123", "X-Float": "1.0", "X-Double": "1.0", - "X-HeaderIntegerList": "1, 2, 3", + "X-IntegerList": "1, 2, 3", }, body: "", params: { @@ -171,12 +172,12 @@ apply InputAndOutputWithHeaders @httpResponseTests([ headers: { "X-Boolean1": "true", "X-Boolean2": "false", - "X-HeaderBooleanList": "true, false, true" + "X-BooleanList": "true, false, true" }, body: "", params: { headerTrueBool: true, - headerFalseBool: true, + headerFalseBool: false, headerBooleanList: [true, false, true] } }, @@ -186,7 +187,7 @@ apply InputAndOutputWithHeaders @httpResponseTests([ protocol: "aws.rest-json-1.1", code: 200, headers: { - "X-HeaderTimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" + "X-TimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" }, body: "", params: { @@ -200,7 +201,7 @@ apply InputAndOutputWithHeaders @httpResponseTests([ code: 200, headers: { "X-Enum": "Foo", - "X-EnumList": "Foo, Baz, Bar" + "X-EnumList": "Foo, Bar, Baz" }, body: "", params: { @@ -399,5 +400,5 @@ structure TimestampFormatHeadersIO { targetHttpDate: HttpDate, @httpHeader("X-targetDateTime") - targetDateTime: HttpDate, + targetDateTime: DateTime, } diff --git a/smithy-aws-protocol-tests/model/rest-json/http-labels.smithy b/smithy-aws-protocol-tests/model/rest-json/http-labels.smithy index 474c3a0e276..1ae4c6a1eff 100644 --- a/smithy-aws-protocol-tests/model/rest-json/http-labels.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/http-labels.smithy @@ -5,6 +5,7 @@ $version: "0.5.0" namespace aws.protocols.tests.restjson +use aws.protocols.tests.shared#DateTime use aws.protocols.tests.shared#EpochSeconds use aws.protocols.tests.shared#HttpDate use smithy.test#httpRequestTests @@ -141,7 +142,7 @@ structure HttpRequestWithLabelsAndTimestampFormatInput { @httpLabel @required - targetDateTime: HttpDate, + targetDateTime: DateTime, } // This example uses a greedy label and a normal label. diff --git a/smithy-aws-protocol-tests/model/rest-json/http-query.smithy b/smithy-aws-protocol-tests/model/rest-json/http-query.smithy index 6a858852ccc..cd31080874c 100644 --- a/smithy-aws-protocol-tests/model/rest-json/http-query.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/http-query.smithy @@ -30,7 +30,7 @@ apply AllQueryStringTypes @httpRequestTests([ documentation: "Serializes query string parameters with all supported types", protocol: "aws.rest-json-1.1", method: "GET", - uri: "/AllQueryStringTypes", + uri: "/AllQueryStringTypesInput", body: "", queryParams: [ "String=Hello%20there", @@ -60,9 +60,9 @@ apply AllQueryStringTypes @httpRequestTests([ "BooleanList=false", "BooleanList=true", "Timestamp=1", - "TimestampList=1", - "TimestampList=2", - "TimestampList=3", + "TimestampList=1970-01-01T00%3A00%3A01Z", + "TimestampList=1970-01-01T00%3A00%3A02Z", + "TimestampList=1970-01-01T00%3A00%3A03Z", "Enum=Foo", "EnumList=Foo", "EnumList=Baz", @@ -254,7 +254,6 @@ apply IgnoreQueryParamsInResponse @httpResponseTests([ body: "", bodyMediaType: "json", params: { - baz: "bam" } } ]) @@ -324,10 +323,10 @@ apply QueryIdempotencyTokenAutoFill @httpRequestTests([ uri: "/QueryIdempotencyTokenAutoFill", body: "", queryParams: [ - "token=00000000-0000-4000-8000-000000000123", + "token=00000000-0000-4000-8000-000000000000", ], params: { - token: "00000000-0000-4000-8000-000000000123" + token: "00000000-0000-4000-8000-000000000000" } } ]) diff --git a/smithy-aws-protocol-tests/model/rest-json/json-lists.smithy b/smithy-aws-protocol-tests/model/rest-json/json-lists.smithy index 67ee209055d..3cd2136af3f 100644 --- a/smithy-aws-protocol-tests/model/rest-json/json-lists.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/json-lists.smithy @@ -73,14 +73,14 @@ apply JsonLists @httpRequestTests([ "qux" ] ], - "structureList": [ + "myStructureList": [ { - "a": "1", - "b": "2" + "value": "1", + "other": "2" }, { - "a": "3", - "b": "4" + "value": "3", + "other": "4" } ] }""", @@ -211,14 +211,14 @@ apply JsonLists @httpResponseTests([ "qux" ] ], - "structureList": [ + "myStructureList": [ { - "a": "1", - "b": "2" + "value": "1", + "other": "2" }, { - "a": "3", - "b": "4" + "value": "3", + "other": "4" } ] }""", diff --git a/smithy-aws-protocol-tests/model/rest-json/json-structs.smithy b/smithy-aws-protocol-tests/model/rest-json/json-structs.smithy index ee2c5db481b..1e15b0864a3 100644 --- a/smithy-aws-protocol-tests/model/rest-json/json-structs.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/json-structs.smithy @@ -30,7 +30,6 @@ apply SimpleScalarProperties @httpRequestTests([ uri: "/SimpleScalarProperties", body: """ { - "foo": "Foo", "stringValue": "string", "trueBooleanValue": true, "falseBooleanValue": false, @@ -69,7 +68,6 @@ apply SimpleScalarProperties @httpResponseTests([ code: 200, body: """ { - "foo": "Foo", "stringValue": "string", "trueBooleanValue": true, "falseBooleanValue": false, @@ -453,7 +451,7 @@ apply RecursiveShapes @httpRequestTests([ documentation: "Serializes recursive structures", protocol: "aws.rest-json-1.1", method: "PUT", - uri: "/JsonEnums", + uri: "/RecursiveShapes", body: """ { "nested": { diff --git a/smithy-aws-protocol-tests/model/rest-json/main.smithy b/smithy-aws-protocol-tests/model/rest-json/main.smithy index c5aec15171a..c34057f1dff 100644 --- a/smithy-aws-protocol-tests/model/rest-json/main.smithy +++ b/smithy-aws-protocol-tests/model/rest-json/main.smithy @@ -2,10 +2,12 @@ $version: "0.5.0" namespace aws.protocols.tests.restjson +use aws.api#service use smithy.test#httpRequestTests use smithy.test#httpResponseTests /// A REST JSON service that sends JSON requests and responses. +@service(sdkId: "Rest Json Protocol") @protocols([{"name": "aws.rest-json-1.1"}]) service RestJson { version: "2019-12-16", diff --git a/smithy-aws-protocol-tests/model/rest-xml/document-lists.smithy b/smithy-aws-protocol-tests/model/rest-xml/document-lists.smithy index cf649cd0d35..f8128568bb5 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/document-lists.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/document-lists.smithy @@ -75,7 +75,7 @@ apply XmlLists @httpRequestTests([ baz qux - + foo bar @@ -166,7 +166,7 @@ apply XmlLists @httpResponseTests([ baz qux - + foo bar diff --git a/smithy-aws-protocol-tests/model/rest-xml/document-maps.smithy b/smithy-aws-protocol-tests/model/rest-xml/document-maps.smithy index b5241eb3793..8fb650a3207 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/document-maps.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/document-maps.smithy @@ -126,13 +126,13 @@ apply XmlMapsXmlName @httpRequestTests([ - foo + foo there - baz + baz bye @@ -167,13 +167,13 @@ apply XmlMapsXmlName @httpResponseTests([ - foo + foo there - baz + baz bye diff --git a/smithy-aws-protocol-tests/model/rest-xml/document-structs.smithy b/smithy-aws-protocol-tests/model/rest-xml/document-structs.smithy index bdbc66602ab..13532ac0212 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/document-structs.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/document-structs.smithy @@ -477,7 +477,7 @@ apply RecursiveShapes @httpRequestTests([ documentation: "Serializes recursive structures", protocol: "aws.rest-xml", method: "PUT", - uri: "/XmlEnums", + uri: "/RecursiveShapes", body: """ @@ -587,7 +587,7 @@ apply XmlNamespaces @httpRequestTests([ method: "POST", uri: "/XmlNamespaces", body: """ - + Foo @@ -595,7 +595,7 @@ apply XmlNamespaces @httpRequestTests([ Baz - + """, bodyMediaType: "application/xml", headers: { @@ -620,7 +620,7 @@ apply XmlNamespaces @httpResponseTests([ protocol: "aws.rest-xml", code: 200, body: """ - + Foo @@ -628,7 +628,7 @@ apply XmlNamespaces @httpResponseTests([ Baz - + """, bodyMediaType: "application/xml", headers: { diff --git a/smithy-aws-protocol-tests/model/rest-xml/document-xml-attributes.smithy b/smithy-aws-protocol-tests/model/rest-xml/document-xml-attributes.smithy index bfa2295ffd8..7c22a405c68 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/document-xml-attributes.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/document-xml-attributes.smithy @@ -23,7 +23,7 @@ apply XmlAttributes @httpRequestTests([ method: "PUT", uri: "/XmlAttributes", body: """ - + hi """, @@ -45,7 +45,7 @@ apply XmlAttributes @httpResponseTests([ protocol: "aws.rest-xml", code: 200, body: """ - + hi """, @@ -84,7 +84,7 @@ apply XmlAttributesOnPayload @httpRequestTests([ method: "PUT", uri: "/XmlAttributesOnPayload", body: """ - + hi """, @@ -108,7 +108,7 @@ apply XmlAttributesOnPayload @httpResponseTests([ protocol: "aws.rest-xml", code: 200, body: """ - + hi """, diff --git a/smithy-aws-protocol-tests/model/rest-xml/empty-input-output.smithy b/smithy-aws-protocol-tests/model/rest-xml/empty-input-output.smithy index 18bd4c1fee9..0c6484d3a13 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/empty-input-output.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/empty-input-output.smithy @@ -20,7 +20,7 @@ apply NoInputAndNoOutput @httpRequestTests([ documentation: "No input serializes no payload", protocol: "aws.rest-xml", method: "POST", - uri: "/NoInputAndOutput", + uri: "/NoInputAndNoOutput", body: "" } ]) @@ -50,7 +50,7 @@ apply NoInputAndOutput @httpRequestTests([ documentation: "No input serializes no payload", protocol: "aws.rest-xml", method: "POST", - uri: "/NoInputAndOutput", + uri: "/NoInputAndOutputOutput", body: "" } ]) diff --git a/smithy-aws-protocol-tests/model/rest-xml/http-headers.smithy b/smithy-aws-protocol-tests/model/rest-xml/http-headers.smithy index bd4b65ff184..93a4af9f2b6 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/http-headers.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/http-headers.smithy @@ -6,6 +6,7 @@ $version: "0.5.0" namespace aws.protocols.tests.restxml use aws.protocols.tests.shared#BooleanList +use aws.protocols.tests.shared#DateTime use aws.protocols.tests.shared#EpochSeconds use aws.protocols.tests.shared#FooEnum use aws.protocols.tests.shared#FooEnumList @@ -57,7 +58,7 @@ apply InputAndOutputWithHeaders @httpRequestTests([ "X-Long": "123", "X-Float": "1.0", "X-Double": "1.0", - "X-HeaderIntegerList": "1, 2, 3", + "X-IntegerList": "1, 2, 3", }, body: "", params: { @@ -79,12 +80,12 @@ apply InputAndOutputWithHeaders @httpRequestTests([ headers: { "X-Boolean1": "true", "X-Boolean2": "false", - "X-HeaderBooleanList": "true, false, true" + "X-BooleanList": "true, false, true" }, body: "", params: { headerTrueBool: true, - headerFalseBool: true, + headerFalseBool: false, headerBooleanList: [true, false, true] } }, @@ -95,7 +96,7 @@ apply InputAndOutputWithHeaders @httpRequestTests([ method: "POST", uri: "/InputAndOutputWithHeaders", headers: { - "X-HeaderTimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" + "X-TimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" }, body: "", params: { @@ -110,7 +111,7 @@ apply InputAndOutputWithHeaders @httpRequestTests([ uri: "/InputAndOutputWithHeaders", headers: { "X-Enum": "Foo", - "X-EnumList": "Foo, Baz, Bar" + "X-EnumList": "Foo, Bar, Baz" }, body: "", params: { @@ -150,7 +151,7 @@ apply InputAndOutputWithHeaders @httpResponseTests([ "X-Long": "123", "X-Float": "1.0", "X-Double": "1.0", - "X-HeaderIntegerList": "1, 2, 3", + "X-IntegerList": "1, 2, 3", }, body: "", params: { @@ -171,12 +172,12 @@ apply InputAndOutputWithHeaders @httpResponseTests([ headers: { "X-Boolean1": "true", "X-Boolean2": "false", - "X-HeaderBooleanList": "true, false, true" + "X-BooleanList": "true, false, true" }, body: "", params: { headerTrueBool: true, - headerFalseBool: true, + headerFalseBool: false, headerBooleanList: [true, false, true] } }, @@ -186,7 +187,7 @@ apply InputAndOutputWithHeaders @httpResponseTests([ protocol: "aws.rest-xml", code: 200, headers: { - "X-HeaderTimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" + "X-TimestampList": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" }, body: "", params: { @@ -200,7 +201,7 @@ apply InputAndOutputWithHeaders @httpResponseTests([ code: 200, headers: { "X-Enum": "Foo", - "X-EnumList": "Foo, Baz, Bar" + "X-EnumList": "Foo, Bar, Baz" }, body: "", params: { @@ -399,5 +400,5 @@ structure TimestampFormatHeadersIO { targetHttpDate: HttpDate, @httpHeader("X-targetDateTime") - targetDateTime: HttpDate, + targetDateTime: DateTime, } diff --git a/smithy-aws-protocol-tests/model/rest-xml/http-labels.smithy b/smithy-aws-protocol-tests/model/rest-xml/http-labels.smithy index 0f9d665b901..6fc1877e849 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/http-labels.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/http-labels.smithy @@ -5,6 +5,7 @@ $version: "0.5.0" namespace aws.protocols.tests.restxml +use aws.protocols.tests.shared#DateTime use aws.protocols.tests.shared#EpochSeconds use aws.protocols.tests.shared#HttpDate use smithy.test#httpRequestTests @@ -141,7 +142,7 @@ structure HttpRequestWithLabelsAndTimestampFormatInput { @httpLabel @required - targetDateTime: HttpDate, + targetDateTime: DateTime, } // This example uses a greedy label and a normal label. diff --git a/smithy-aws-protocol-tests/model/rest-xml/http-payload.smithy b/smithy-aws-protocol-tests/model/rest-xml/http-payload.smithy index addc34aa7be..7a3f57d1ed2 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/http-payload.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/http-payload.smithy @@ -229,7 +229,7 @@ apply HttpPayloadWithXmlName @httpRequestTests([ documentation: "Serializes a structure in the payload using a wrapper name based on xmlName", protocol: "aws.rest-xml", method: "PUT", - uri: "/HttpPayloadWithStructure", + uri: "/HttpPayloadWithXmlName", body: "Phreddy", bodyMediaType: "application/xml", headers: { @@ -288,7 +288,7 @@ apply HttpPayloadWithXmlNamespace @httpRequestTests([ method: "PUT", uri: "/HttpPayloadWithXmlNamespace", body: """ - + Phreddy """, bodyMediaType: "application/xml", @@ -310,7 +310,7 @@ apply HttpPayloadWithXmlNamespace @httpResponseTests([ protocol: "aws.rest-xml", code: 200, body: """ - + Phreddy """, bodyMediaType: "application/xml", @@ -351,7 +351,7 @@ apply HttpPayloadWithXmlNamespaceAndPrefix @httpRequestTests([ method: "PUT", uri: "/HttpPayloadWithXmlNamespaceAndPrefix", body: """ - + Phreddy """, bodyMediaType: "application/xml", @@ -373,7 +373,7 @@ apply HttpPayloadWithXmlNamespaceAndPrefix @httpResponseTests([ protocol: "aws.rest-xml", code: 200, body: """ - + Phreddy """, bodyMediaType: "application/xml", diff --git a/smithy-aws-protocol-tests/model/rest-xml/http-query.smithy b/smithy-aws-protocol-tests/model/rest-xml/http-query.smithy index 543ec187a55..c4dcb9925ba 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/http-query.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/http-query.smithy @@ -30,7 +30,7 @@ apply AllQueryStringTypes @httpRequestTests([ documentation: "Serializes query string parameters with all supported types", protocol: "aws.rest-xml", method: "GET", - uri: "/AllQueryStringTypes", + uri: "/AllQueryStringTypesInput", body: "", queryParams: [ "String=Hello%20there", @@ -60,9 +60,9 @@ apply AllQueryStringTypes @httpRequestTests([ "BooleanList=false", "BooleanList=true", "Timestamp=1", - "TimestampList=1", - "TimestampList=2", - "TimestampList=3", + "TimestampList=1970-01-01T00%3A00%3A01Z", + "TimestampList=1970-01-01T00%3A00%3A02Z", + "TimestampList=1970-01-01T00%3A00%3A03Z", "Enum=Foo", "EnumList=Foo", "EnumList=Baz", @@ -324,10 +324,10 @@ apply QueryIdempotencyTokenAutoFill @httpRequestTests([ uri: "/QueryIdempotencyTokenAutoFill", body: "", queryParams: [ - "token=00000000-0000-4000-8000-000000000123", + "token=00000000-0000-4000-8000-000000000000", ], params: { - token: "00000000-0000-4000-8000-000000000123" + token: "00000000-0000-4000-8000-000000000000" } } ]) diff --git a/smithy-aws-protocol-tests/model/rest-xml/main.smithy b/smithy-aws-protocol-tests/model/rest-xml/main.smithy index 39e4b258ca7..bfd1d90f30b 100644 --- a/smithy-aws-protocol-tests/model/rest-xml/main.smithy +++ b/smithy-aws-protocol-tests/model/rest-xml/main.smithy @@ -2,10 +2,12 @@ $version: "0.5.0" namespace aws.protocols.tests.restxml +use aws.api#service use smithy.test#httpRequestTests use smithy.test#httpResponseTests /// A REST XML service that sends XML requests and responses. +@service(sdkId: "Rest Xml Protocol") @protocols([{"name": "aws.rest-xml"}]) service RestXml { version: "2019-12-16",