Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol test fixes #321

Merged
merged 5 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions smithy-aws-protocol-tests/model/ec2-query/input-lists.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
14 changes: 7 additions & 7 deletions smithy-aws-protocol-tests/model/ec2-query/input.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
},
{
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions smithy-aws-protocol-tests/model/ec2-query/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion smithy-aws-protocol-tests/model/ec2-query/xml-lists.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ apply XmlLists @httpResponseTests([
<member>baz</member>
<member>qux</member>
</member>
<nestedStringList>
</nestedStringList>
<renamed>
<item>foo</item>
<item>bar</item>
Expand Down
18 changes: 9 additions & 9 deletions smithy-aws-protocol-tests/model/json-rpc-1-1/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"params": {},
"headers": {
"Content-Type": "application/x-amz-json-1.1",
"X-Amz-Target": "JsonProtocolService.OperationWithOptionalInputOutput"
"X-Amz-Target": "JsonProtocol.EmptyOperation"
}
}
],
Expand All @@ -72,7 +72,6 @@
"headers": {
"Content-Type": "application/x-amz-json-1.1"
},
"requireHeaders": ["Content-Length"],
"bodyMediaType": "application/json",
"body": "{}",
"params": {}
Expand Down Expand Up @@ -522,7 +521,7 @@
"MapOfStrings": {}
},
"bodyMediaType": "application/json",
"body": "{\"MapOfStrings\":[]}"
"body": "{\"MapOfStrings\":{}}"
},
{
"id": "serializes_map_of_list_shapes",
Expand Down Expand Up @@ -626,7 +625,7 @@
"SimpleStruct": {}
},
"bodyMediaType": "application/json",
"body": "{\"SimpleStruct\":[]}"
"body": "{\"SimpleStruct\":{}}"
},
{
"id": "serializes_structure_which_have_no_members",
Expand All @@ -638,7 +637,7 @@
"EmptyStruct": {}
},
"bodyMediaType": "application/json",
"body": "{\"EmptyStruct\":[]}"
"body": "{\"EmptyStruct\":{}}"
},
{
"id": "serializes_recursive_structure_shapes",
Expand Down Expand Up @@ -1000,7 +999,9 @@
"code": 200,
"headers": {
"X-Amzn-Requestid": "amazon-uniq-request-id"
}
},
"bodyMediaType": "application/json",
"body": "{}"
}
]
}
Expand Down Expand Up @@ -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": "{}"
Expand All @@ -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\"}"
}
Expand Down
34 changes: 18 additions & 16 deletions smithy-aws-protocol-tests/model/query/input-maps.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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""",
Expand All @@ -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
Expand Down Expand Up @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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
Expand All @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions smithy-aws-protocol-tests/model/query/input.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions smithy-aws-protocol-tests/model/query/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion smithy-aws-protocol-tests/model/query/xml-lists.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ apply XmlLists @httpResponseTests([
<member>baz</member>
<member>qux</member>
</member>
<nestedStringList>
</nestedStringList>
<renamed>
<item>foo</item>
<item>bar</item>
Expand Down
4 changes: 2 additions & 2 deletions smithy-aws-protocol-tests/model/query/xml-maps.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ apply XmlMapsXmlName @httpResponseTests([
<XmlMapsXmlNameResult>
<myMap>
<entry>
<Name>foo</Name>
<Attribute>foo</Attribute>
<Setting>
<hi>there</hi>
</Setting>
</entry>
<entry>
<Name>baz</Name>
<Attribute>baz</Attribute>
<Setting>
<hi>bye</hi>
</Setting>
Expand Down
16 changes: 8 additions & 8 deletions smithy-aws-protocol-tests/model/query/xml-structs.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ apply XmlTimestamps @httpResponseTests([
code: 200,
body: """
<XmlTimestampsResponse xmlns="https://example.com/">
<QueryXmlTimestampsResult>
<XmlTimestampsResult>
<normal>2014-04-29T18:30:38Z</normal>
</QueryXmlTimestampsResult>
</XmlTimestampsResult>
</XmlTimestampsResponse>
""",
bodyMediaType: "application/xml",
Expand All @@ -139,9 +139,9 @@ apply XmlTimestamps @httpResponseTests([
code: 200,
body: """
<XmlTimestampsResponse xmlns="https://example.com/">
<QueryXmlTimestampsResult>
<XmlTimestampsResult>
<dateTime>2014-04-29T18:30:38Z</dateTime>
</QueryXmlTimestampsResult>
</XmlTimestampsResult>
</XmlTimestampsResponse>
""",
bodyMediaType: "application/xml",
Expand All @@ -159,9 +159,9 @@ apply XmlTimestamps @httpResponseTests([
code: 200,
body: """
<XmlTimestampsResponse xmlns="https://example.com/">
<QueryXmlTimestampsResult>
<XmlTimestampsResult>
<epochSeconds>1398796238</epochSeconds>
</QueryXmlTimestampsResult>
</XmlTimestampsResult>
</XmlTimestampsResponse>
""",
bodyMediaType: "application/xml",
Expand All @@ -179,9 +179,9 @@ apply XmlTimestamps @httpResponseTests([
code: 200,
body: """
<XmlTimestampsResponse xmlns="https://example.com/">
<QueryXmlTimestampsResult>
<XmlTimestampsResult>
<httpDate>Tue, 29 Apr 2014 18:30:38 GMT</httpDate>
</QueryXmlTimestampsResult>
</XmlTimestampsResult>
</XmlTimestampsResponse>
""",
bodyMediaType: "application/xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
])

Expand Down Expand Up @@ -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"
}
])

Expand Down
3 changes: 2 additions & 1 deletion smithy-aws-protocol-tests/model/rest-json/errors.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading