diff --git a/smithy-aws-protocol-tests/model/restJson1/http-query.smithy b/smithy-aws-protocol-tests/model/restJson1/http-query.smithy index 23426e98657..3ac3bb64604 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-query.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-query.smithy @@ -700,3 +700,30 @@ structure QueryParamsAsStringListMapInput { @httpQueryParams foo: StringListMap } + +/// Does not encode `[]` chars in serialized URIs. +@readonly +@http(uri: "/SkipsEncodingSquareBrackets", method: "GET") +operation SkipsEncodingSquareBrackets { + input := { + @httpQuery("brackets[]") + paramWithBrackets: String + } +} + +apply SkipsEncodingSquareBrackets @httpRequestTests([ + { + id: "RestJsonSkipsEncodingSquareBrackets" + documentation: "Do not encode square brackets (`[` and `]`) in the names of query parameters." + protocol: restJson1 + method: "GET" + uri: "/SkipsEncodingSquareBrackets" + body: "" + queryParams: [ + "brackets[]=Text" + ] + params: { + paramWithBrackets: "Text" + } + } +]) diff --git a/smithy-aws-protocol-tests/model/restJson1/main.smithy b/smithy-aws-protocol-tests/model/restJson1/main.smithy index 33321eb69eb..b9a425d6778 100644 --- a/smithy-aws-protocol-tests/model/restJson1/main.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/main.smithy @@ -50,6 +50,7 @@ service RestJson { QueryIdempotencyTokenAutoFill, QueryPrecedence, QueryParamsAsStringListMap, + SkipsEncodingSquareBrackets // @httpPrefixHeaders tests HttpPrefixHeaders, diff --git a/smithy-aws-protocol-tests/model/restXml/http-query.smithy b/smithy-aws-protocol-tests/model/restXml/http-query.smithy index 017003b411e..d0c70d23887 100644 --- a/smithy-aws-protocol-tests/model/restXml/http-query.smithy +++ b/smithy-aws-protocol-tests/model/restXml/http-query.smithy @@ -586,3 +586,30 @@ structure QueryParamsAsStringListMapInput { @httpQueryParams foo: StringListMap } + +/// Does not encode `[]` chars in serialized URIs. +@readonly +@http(uri: "/SkipsEncodingSquareBrackets", method: "GET") +operation SkipsEncodingSquareBrackets { + input := { + @httpQuery("brackets[]") + paramWithBrackets: String + } +} + +apply SkipsEncodingSquareBrackets @httpRequestTests([ + { + id: "RestXmlSkipsEncodingSquareBrackets" + documentation: "Do not encode square brackets (`[` and `]`) in the names of query parameters." + protocol: restXml + method: "GET" + uri: "/SkipsEncodingSquareBrackets" + body: "" + queryParams: [ + "brackets[]=Text" + ] + params: { + paramWithBrackets: "Text" + } + } +]) diff --git a/smithy-aws-protocol-tests/model/restXml/main.smithy b/smithy-aws-protocol-tests/model/restXml/main.smithy index 75380f4a8c3..795f17cc650 100644 --- a/smithy-aws-protocol-tests/model/restXml/main.smithy +++ b/smithy-aws-protocol-tests/model/restXml/main.smithy @@ -45,6 +45,7 @@ service RestXml { QueryIdempotencyTokenAutoFill, QueryPrecedence, QueryParamsAsStringListMap, + SkipsEncodingSquareBrackets // @httpPrefixHeaders tests HttpPrefixHeaders,