diff --git a/docs/source/1.0/spec/core/http-traits.rst b/docs/source/1.0/spec/core/http-traits.rst index e389ba563e1..df55341c31d 100644 --- a/docs/source/1.0/spec/core/http-traits.rst +++ b/docs/source/1.0/spec/core/http-traits.rst @@ -663,7 +663,7 @@ structure with the ``httpLabel`` trait MUST have a corresponding ``1985-04-12T23%3A20%3A50.52Z``). The :ref:`timestampFormat-trait` MAY be used to use a custom serialization format. - Reserved characters defined in :rfc:`section 2.2 of RFC3986 <3986#section-2.2>` - MUST be percent-encoded_ (that is, ``:/?#[]@!$&'()*+,;=``). + and the `%` itself MUST be percent-encoded_ (that is, ``:/?#[]@!$&'()*+,;=%``). - However, if the label is greedy, then "/" MUST NOT be percent-encoded because greedy labels are meant to span multiple path segments. @@ -894,8 +894,8 @@ request: * "&" is used to separate query string parameter key-value pairs. * "=" is used to separate query string parameter names from values. -* Reserved characters in keys and values as defined in :rfc:`section 2.2 of RFC3986 <3986#section-2.2>` - MUST be percent-encoded_ (that is, ``:/?#[]@!$&'()*+,;=``). +* Reserved characters in keys and values as defined in :rfc:`section 2.2 of RFC3986 <3986#section-2.2>` and `%` + MUST be percent-encoded_ (that is, ``:/?#[]@!$&'()*+,;=%``). * ``boolean`` values are serialized as ``true`` or ``false``. * ``timestamp`` values are serialized as an :rfc:`3339` ``date-time`` string by default (for example, ``1985-04-12T23:20:50.52Z``, diff --git a/smithy-aws-protocol-tests/model/restJson1/http-labels.smithy b/smithy-aws-protocol-tests/model/restJson1/http-labels.smithy index dc71bec9867..c61b5b52001 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-labels.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-labels.smithy @@ -39,6 +39,24 @@ apply HttpRequestWithLabels @httpRequestTests([ timestamp: 1576540098 } }, + { + id: "RestJsonHttpRequestLabelEscaping", + documentation: "Sends a GET request that uses URI label bindings", + protocol: restJson1, + method: "GET", + uri: "/HttpRequestWithLabels/%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z", + body: "", + params: { + string: "%:/?#[]@!$&'()*+,;=😹", + short: 1, + integer: 2, + long: 3, + float: 4.1, + double: 5.1, + boolean: true, + timestamp: 1576540098 + } + }, ]) structure HttpRequestWithLabelsInput { @@ -159,10 +177,10 @@ apply HttpRequestWithGreedyLabelInPath @httpRequestTests([ documentation: "Serializes greedy labels and normal labels", protocol: restJson1, method: "GET", - uri: "/HttpRequestWithGreedyLabelInPath/foo/hello/baz/there/guy", + uri: "/HttpRequestWithGreedyLabelInPath/foo/hello%2Fescape/baz/there/guy", body: "", params: { - foo: "hello", + foo: "hello/escape", baz: "there/guy", } }, diff --git a/smithy-aws-protocol-tests/model/restJson1/http-query.smithy b/smithy-aws-protocol-tests/model/restJson1/http-query.smithy index 7b52d5b77a2..98f84362121 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-query.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-query.smithy @@ -111,6 +111,20 @@ apply AllQueryStringTypes @httpRequestTests([ "QueryParamsStringKeyB": "Bar", }, } + }, + { + id: "RestJsonQueryStringEscaping", + documentation: "Handles escaping all required characters in the query string.", + protocol: restJson1, + method: "GET", + uri: "/AllQueryStringTypesInput", + body: "", + queryParams: [ + "String=%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9", + ], + params: { + queryString: "%:/?#[]@!$&'()*+,;=😹" + } } ])