From b4ec3e7a4907e56ecda8e672896b474f3b398f67 Mon Sep 17 00:00:00 2001 From: Hayden Baker Date: Thu, 17 Nov 2022 09:44:16 -0800 Subject: [PATCH 1/3] Clarify the usage of offsets in the timestampFormat protocol-trait While the datetime specification mentions that UTC offsets are not allowed, they should be parsed gracefully and normalized to zero (no offset). --- docs/source-2.0/spec/protocol-traits.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source-2.0/spec/protocol-traits.rst b/docs/source-2.0/spec/protocol-traits.rst index 19a62a4cb91..0b86c3500d5 100644 --- a/docs/source-2.0/spec/protocol-traits.rst +++ b/docs/source-2.0/spec/protocol-traits.rst @@ -221,6 +221,8 @@ Smithy defines the following built-in timestamp formats: :rfc:`3339#section-5.6` with no UTC offset and optional fractional precision (for example, ``1985-04-12T23:20:50.52Z``). + *However*, offsets will still be parsed gracefully, but the datetime + will be normalized to an offset of zero (i.e. converted to UTC) * - http-date - An HTTP date as defined by the ``IMF-fixdate`` production in :rfc:`7231#section-7.1.1.1` (for example, From d3c9a0a1e453f534ff353dfe5ee720a5ab18e923 Mon Sep 17 00:00:00 2001 From: Hayden Baker Date: Thu, 17 Nov 2022 09:46:49 -0800 Subject: [PATCH 2/3] Add protocol test coverage for datetime-timestamps with offsets While the datetime specification mentions that UTC offsets are not allowed, they should be parsed gracefully and normalized to zero (no offset). These changes add tests to verify the correct serialization/deserialization behavior of both client and server protocol implementations. --- .../model/awsJson1_1/datetime-offsets.smithy | 118 ++++++++++++++++++ .../model/awsJson1_1/main.smithy | 3 + .../model/awsQuery/datetime-offsets.smithy | 114 +++++++++++++++++ .../model/awsQuery/main.smithy | 3 + .../model/ec2Query/datetime-offsets.smithy | 110 ++++++++++++++++ .../model/ec2Query/main.smithy | 3 + .../model/restJson1/datetime-offsets.smithy | 104 +++++++++++++++ .../model/restJson1/main.smithy | 3 + .../model/restXml/datetime-offsets.smithy | 118 ++++++++++++++++++ .../model/restXml/main.smithy | 3 + 10 files changed, 579 insertions(+) create mode 100644 smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy create mode 100644 smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy create mode 100644 smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy create mode 100644 smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy create mode 100644 smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy diff --git a/smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy new file mode 100644 index 00000000000..c7c6472ddcb --- /dev/null +++ b/smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy @@ -0,0 +1,118 @@ +$version: "2.0" + +namespace aws.protocoltests.json + +use aws.protocols#awsJson1_1 +use aws.protocoltests.shared#DateTime +use smithy.test#httpRequestTests +use smithy.test#httpResponseTests + +// These tests are for verifying the client can correctly parse +// the `DateTime` timestamp with an offset +@tags(["client-only"]) +@http(uri: "/DatetimeOffsets", method: "POST") +operation DatetimeOffsets { + output: DatetimeOffsetsOutput +} + +apply DatetimeOffsets @httpResponseTests([ + { + id: "AwsJson11DateTimeWithNegativeOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: awsJson1_1, + code: 200, + body: + """ + { + "datetime": "2019-12-16T22:48:18-01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + headers: { + "Content-Type": "application/x-amz-json-1.1" + }, + appliesTo: "client" + }, + { + id: "AwsJson11DateTimeWithPositiveOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: awsJson1_1, + code: 200, + body: + """ + { + "datetime": "2019-12-17T00:48:18+01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + headers: { + "Content-Type": "application/x-amz-json-1.1" + }, + appliesTo: "client" + }, +]) + +structure DatetimeOffsetsOutput { + datetime: DateTime +} + +// These tests are for verifying the server can correctly parse +// the `DateTime` timestamp with an offset +@tags(["server-only"]) +@http(uri: "/OffsetDatetimes", method: "POST") +operation OffsetDatetimes { + input: OffsetDatetimesInput +} + +apply OffsetDatetimes @httpRequestTests([ + { + id: "AwsJson11NegativeOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: awsJson1_1, + method: "POST", + uri: "/", + body: + """ + { + "datetime": "2019-12-16T22:48:18-01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + headers: { + "Content-Type": "application/x-amz-json-1.1", + "X-Amz-Target": "JsonProtocol.OffsetDatetimes", + }, + appliesTo: "server" + }, + { + id: "AwsJson11PositiveOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: awsJson1_1, + method: "POST", + uri: "/", + body: + """ + { + "datetime": "2019-12-17T00:48:18+01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + headers: { + "Content-Type": "application/x-amz-json-1.1", + "X-Amz-Target": "JsonProtocol.OffsetDatetimes", + }, + appliesTo: "server" + } +]) + +structure OffsetDatetimesInput { + datetime: DateTime +} diff --git a/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy b/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy index 4f1a467d56a..406698c62ed 100644 --- a/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy +++ b/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy @@ -36,6 +36,9 @@ service JsonProtocol { // custom endpoints with paths HostWithPathOperation, + + DatetimeOffsets, + OffsetDatetimes ], } diff --git a/smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy new file mode 100644 index 00000000000..f609120a5c1 --- /dev/null +++ b/smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy @@ -0,0 +1,114 @@ +$version: "2.0" + +namespace aws.protocoltests.query + +use aws.protocols#awsQuery +use aws.protocoltests.shared#DateTime +use smithy.test#httpRequestTests +use smithy.test#httpResponseTests + +// These tests are for verifying the client can correctly parse +// the `DateTime` timestamp with an offset +@tags(["client-only"]) +operation DatetimeOffsets { + output: DatetimeOffsetsOutput +} + +apply DatetimeOffsets @httpResponseTests([ + { + id: "AwsQueryDateTimeWithNegativeOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: awsQuery, + code: 200, + body: """ + + + 2019-12-16T22:48:18-01:00 + + + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/xml", + headers: { + "Content-Type": "text/xml" + }, + appliesTo: "client" + }, + { + id: "AwsQueryDateTimeWithPositiveOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: awsQuery, + code: 200, + body: """ + + + 2019-12-17T00:48:18+01:00 + + + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/xml", + headers: { + "Content-Type": "text/xml" + }, + appliesTo: "client" + }, +]) + +structure DatetimeOffsetsOutput { + datetime: DateTime +} + +// These tests are for verifying the server can correctly parse +// the `DateTime` timestamp with an offset +@tags(["server-only"]) +operation OffsetDatetimes { + input: OffsetDatetimesInput +} + +apply OffsetDatetimes @httpRequestTests([ + { + id: "AwsQueryNegativeOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: awsQuery, + method: "POST", + uri: "/", + headers: { + "Content-Type": "application/x-www-form-urlencoded" + }, + requireHeaders: [ + "Content-Length" + ], + body: "Action=OffsetDatetimes&Version=2020-01-08&datetime=2019-12-16T22%3A48%3A18-01%3A00", + bodyMediaType: "application/x-www-form-urlencoded", + params: { + datetime: 1576540098, + } + }, + { + id: "AwsQueryPositiveOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: awsQuery, + method: "POST", + uri: "/", + headers: { + "Content-Type": "application/x-www-form-urlencoded" + }, + requireHeaders: [ + "Content-Length" + ], + body: "Action=OffsetDatetimes&Version=2020-01-08&datetime=2019-12-17T00%3A48%3A18%2B01%3A00", + bodyMediaType: "application/x-www-form-urlencoded", + params: { + datetime: 1576540098, + } + }, +]) + +structure OffsetDatetimesInput { + datetime: DateTime +} diff --git a/smithy-aws-protocol-tests/model/awsQuery/main.smithy b/smithy-aws-protocol-tests/model/awsQuery/main.smithy index 3db3663ab6b..d75435a83ef 100644 --- a/smithy-aws-protocol-tests/model/awsQuery/main.smithy +++ b/smithy-aws-protocol-tests/model/awsQuery/main.smithy @@ -62,5 +62,8 @@ service AwsQuery { // custom endpoints with paths HostWithPathOperation, + + DatetimeOffsets, + OffsetDatetimes, ] } diff --git a/smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy new file mode 100644 index 00000000000..023c75bdfc3 --- /dev/null +++ b/smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy @@ -0,0 +1,110 @@ +$version: "2.0" + +namespace aws.protocoltests.ec2 + +use aws.protocols#ec2Query +use aws.protocoltests.shared#DateTime +use smithy.test#httpRequestTests +use smithy.test#httpResponseTests + +// These tests are for verifying the client can correctly parse +// the `DateTime` timestamp with an offset +@tags(["client-only"]) +operation DatetimeOffsets { + output: DatetimeOffsetsOutput +} + +apply DatetimeOffsets @httpResponseTests([ + { + id: "Ec2QueryDateTimeWithNegativeOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: ec2Query, + code: 200, + body: """ + + 2019-12-16T22:48:18-01:00 + requestid + + """, + bodyMediaType: "application/xml", + headers: { + "Content-Type": "text/xml;charset=UTF-8" + }, + params: { datetime: 1576540098 } + }, + { + id: "Ec2QueryDateTimeWithPositiveOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: ec2Query, + code: 200, + body: """ + + 2019-12-17T00:48:18+01:00 + requestid + + """, + bodyMediaType: "application/xml", + headers: { + "Content-Type": "text/xml;charset=UTF-8" + }, + params: { datetime: 1576540098 } + } +]) + +structure DatetimeOffsetsOutput { + datetime: DateTime +} + +// These tests are for verifying the server can correctly parse +// the `DateTime` timestamp with an offset +@tags(["server-only"]) +operation OffsetDatetimes { + input: OffsetDatetimesInput +} + +apply OffsetDatetimes @httpRequestTests([ + { + id: "Ec2QueryNegativeOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: ec2Query, + method: "POST", + uri: "/", + headers: { + "Content-Type": "application/x-www-form-urlencoded" + }, + requireHeaders: [ + "Content-Length" + ], + body: "Action=OffsetDatetimes&Version=2020-01-08&Datetime=2019-12-16T22%3A48%3A18-01%3A00", + bodyMediaType: "application/x-www-form-urlencoded", + params: { + datetime: 1576540098, + } + }, + { + id: "Ec2QueryPositiveOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: ec2Query, + method: "POST", + uri: "/", + headers: { + "Content-Type": "application/x-www-form-urlencoded" + }, + requireHeaders: [ + "Content-Length" + ], + body: "Action=OffsetDatetimes&Version=2020-01-08&Datetime=2019-12-17T00%3A48%3A18%2B01%3A00", + bodyMediaType: "application/x-www-form-urlencoded", + params: { + datetime: 1576540098, + } + }, +]) + +structure OffsetDatetimesInput { + datetime: DateTime +} diff --git a/smithy-aws-protocol-tests/model/ec2Query/main.smithy b/smithy-aws-protocol-tests/model/ec2Query/main.smithy index e9884a1c875..99cc381f44f 100644 --- a/smithy-aws-protocol-tests/model/ec2Query/main.smithy +++ b/smithy-aws-protocol-tests/model/ec2Query/main.smithy @@ -78,5 +78,8 @@ service AwsEc2 { // custom endpoints with paths HostWithPathOperation, + + DatetimeOffsets, + OffsetDatetimes, ] } diff --git a/smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy new file mode 100644 index 00000000000..dd21a7e1e1e --- /dev/null +++ b/smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy @@ -0,0 +1,104 @@ +$version: "2.0" + +namespace aws.protocoltests.restjson + +use aws.protocols#restJson1 +use aws.protocoltests.shared#DateTime +use smithy.test#httpRequestTests +use smithy.test#httpResponseTests + +// These tests are for verifying the client can correctly parse +// the `DateTime` timestamp with an offset +@tags(["client-only"]) +@http(uri: "/DatetimeOffsets", method: "POST") +operation DatetimeOffsets { + output: DatetimeOffsetsOutput +} + +apply DatetimeOffsets @httpResponseTests([ + { + id: "RestJsonDateTimeWithNegativeOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: restJson1, + code: 200, + body: + """ + { + "datetime": "2019-12-16T22:48:18-01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + appliesTo: "client" + }, + { + id: "RestJsonDateTimeWithPositiveOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: restJson1, + code: 200, + body: + """ + { + "datetime": "2019-12-17T00:48:18+01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + appliesTo: "client" + }, +]) + +structure DatetimeOffsetsOutput { + datetime: DateTime +} + +// These tests are for verifying the server can correctly parse +// the `DateTime` timestamp with an offset +@tags(["server-only"]) +@http(uri: "/OffsetDatetimes", method: "POST") +operation OffsetDatetimes { + input: OffsetDatetimesInput +} + +apply OffsetDatetimes @httpRequestTests([ + { + id: "RestJsonNegativeOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: restJson1, + method: "POST", + uri: "/OffsetDatetimes", + body: + """ + { + "datetime": "2019-12-16T22:48:18-01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + appliesTo: "server" + }, + { + id: "RestJsonPositiveOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: restJson1, + method: "POST", + uri: "/OffsetDatetimes", + body: + """ + { + "datetime": "2019-12-17T00:48:18+01:00" + } + """, + params: { datetime: 1576540098 } + bodyMediaType: "application/json", + appliesTo: "server" + } +]) + +structure OffsetDatetimesInput { + datetime: DateTime +} diff --git a/smithy-aws-protocol-tests/model/restJson1/main.smithy b/smithy-aws-protocol-tests/model/restJson1/main.smithy index 810c292af52..b248c1a33d3 100644 --- a/smithy-aws-protocol-tests/model/restJson1/main.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/main.smithy @@ -137,5 +137,8 @@ service RestJson { TestPayloadStructure, TestPayloadBlob, TestNoPayload, + + DatetimeOffsets, + OffsetDatetimes ] } diff --git a/smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy new file mode 100644 index 00000000000..0ee13974a98 --- /dev/null +++ b/smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy @@ -0,0 +1,118 @@ +$version: "2.0" + +namespace aws.protocoltests.restxml + +use aws.protocols#restXml +use aws.protocoltests.shared#DateTime +use smithy.test#httpRequestTests +use smithy.test#httpResponseTests + +// These tests are for verifying the client can correctly parse +// the `DateTime` timestamp with an offset +@tags(["client-only"]) +@http(uri: "/DatetimeOffsets", method: "POST") +operation DatetimeOffsets { + output: DatetimeOffsetsOutput +} + +apply DatetimeOffsets @httpResponseTests([ + { + id: "RestXmlDateTimeWithNegativeOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: restXml, + code: 200, + body: """ + + 2019-12-16T22:48:18-01:00 + + """, + bodyMediaType: "application/xml", + headers: { + "Content-Type": "application/xml" + }, + params: { datetime: 1576540098 } + }, + { + id: "RestXmlDateTimeWithPositiveOffset", + documentation: """ + Ensures that clients can correctly parse datetime (timestamps) with offsets""", + protocol: restXml, + code: 200, + body: """ + + 2019-12-17T00:48:18+01:00 + + """, + bodyMediaType: "application/xml", + headers: { + "Content-Type": "application/xml" + }, + params: { datetime: 1576540098 } + }, +]) + +structure DatetimeOffsetsOutput { + datetime: DateTime +} + +// These tests are for verifying the server can correctly parse +// the `DateTime` timestamp with an offset +@tags(["server-only"]) +@http(uri: "/OffsetDatetimes", method: "POST") +operation OffsetDatetimes { + input: OffsetDatetimesInput +} + +apply OffsetDatetimes @httpRequestTests([ + { + id: "RestXmlNegativeOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: restXml, + method: "POST", + uri: "/OffsetDatetimes", + body: """ + + 2019-12-17T00:48:18+01:00 + + """, + bodyMediaType: "application/xml", + headers: { + "Content-Type": "application/xml" + }, + requireHeaders: [ + "Content-Length" + ], + params: { + datetime: 1576540098, + } + }, + { + id: "RestXmlPositiveOffsetDatetimes", + documentation: """ + Ensures that servers can correctly parse datetime (timestamps) with offsets""", + protocol: restXml, + method: "POST", + uri: "/OffsetDatetimes", + body: """ + + 2019-12-16T22:48:18-01:00 + + """, + bodyMediaType: "application/xml", + headers: { + "Content-Type": "application/xml" + }, + requireHeaders: [ + "Content-Length" + ], + params: { + datetime: 1576540098, + } + }, +]) + +structure OffsetDatetimesInput { + datetime: DateTime +} diff --git a/smithy-aws-protocol-tests/model/restXml/main.smithy b/smithy-aws-protocol-tests/model/restXml/main.smithy index f18a26efe02..5db88318723 100644 --- a/smithy-aws-protocol-tests/model/restXml/main.smithy +++ b/smithy-aws-protocol-tests/model/restXml/main.smithy @@ -92,5 +92,8 @@ service RestXml { EndpointOperation, EndpointWithHostLabelOperation, EndpointWithHostLabelHeaderOperation, + + DatetimeOffsets, + OffsetDatetimes, ] } From a0b466181727000fbf17ace6345c265f406a4785 Mon Sep 17 00:00:00 2001 From: Hayden Baker Date: Wed, 14 Dec 2022 14:53:38 -0800 Subject: [PATCH 3/3] Remove server-only tests Servers aren't expected to handle datetimes with offsets --- .../model/awsJson1_1/datetime-offsets.smithy | 57 ----------------- .../model/awsJson1_1/main.smithy | 1 - .../model/awsQuery/datetime-offsets.smithy | 52 ---------------- .../model/awsQuery/main.smithy | 1 - .../model/ec2Query/datetime-offsets.smithy | 52 ---------------- .../model/ec2Query/main.smithy | 1 - .../model/restJson1/datetime-offsets.smithy | 49 --------------- .../model/restJson1/main.smithy | 1 - .../model/restXml/datetime-offsets.smithy | 61 ------------------- .../model/restXml/main.smithy | 1 - 10 files changed, 276 deletions(-) diff --git a/smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy index c7c6472ddcb..ec9485138b1 100644 --- a/smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy +++ b/smithy-aws-protocol-tests/model/awsJson1_1/datetime-offsets.smithy @@ -59,60 +59,3 @@ apply DatetimeOffsets @httpResponseTests([ structure DatetimeOffsetsOutput { datetime: DateTime } - -// These tests are for verifying the server can correctly parse -// the `DateTime` timestamp with an offset -@tags(["server-only"]) -@http(uri: "/OffsetDatetimes", method: "POST") -operation OffsetDatetimes { - input: OffsetDatetimesInput -} - -apply OffsetDatetimes @httpRequestTests([ - { - id: "AwsJson11NegativeOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: awsJson1_1, - method: "POST", - uri: "/", - body: - """ - { - "datetime": "2019-12-16T22:48:18-01:00" - } - """, - params: { datetime: 1576540098 } - bodyMediaType: "application/json", - headers: { - "Content-Type": "application/x-amz-json-1.1", - "X-Amz-Target": "JsonProtocol.OffsetDatetimes", - }, - appliesTo: "server" - }, - { - id: "AwsJson11PositiveOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: awsJson1_1, - method: "POST", - uri: "/", - body: - """ - { - "datetime": "2019-12-17T00:48:18+01:00" - } - """, - params: { datetime: 1576540098 } - bodyMediaType: "application/json", - headers: { - "Content-Type": "application/x-amz-json-1.1", - "X-Amz-Target": "JsonProtocol.OffsetDatetimes", - }, - appliesTo: "server" - } -]) - -structure OffsetDatetimesInput { - datetime: DateTime -} diff --git a/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy b/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy index 406698c62ed..e5604e85cad 100644 --- a/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy +++ b/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy @@ -38,7 +38,6 @@ service JsonProtocol { HostWithPathOperation, DatetimeOffsets, - OffsetDatetimes ], } diff --git a/smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy index f609120a5c1..07daa318fa8 100644 --- a/smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy +++ b/smithy-aws-protocol-tests/model/awsQuery/datetime-offsets.smithy @@ -60,55 +60,3 @@ apply DatetimeOffsets @httpResponseTests([ structure DatetimeOffsetsOutput { datetime: DateTime } - -// These tests are for verifying the server can correctly parse -// the `DateTime` timestamp with an offset -@tags(["server-only"]) -operation OffsetDatetimes { - input: OffsetDatetimesInput -} - -apply OffsetDatetimes @httpRequestTests([ - { - id: "AwsQueryNegativeOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: awsQuery, - method: "POST", - uri: "/", - headers: { - "Content-Type": "application/x-www-form-urlencoded" - }, - requireHeaders: [ - "Content-Length" - ], - body: "Action=OffsetDatetimes&Version=2020-01-08&datetime=2019-12-16T22%3A48%3A18-01%3A00", - bodyMediaType: "application/x-www-form-urlencoded", - params: { - datetime: 1576540098, - } - }, - { - id: "AwsQueryPositiveOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: awsQuery, - method: "POST", - uri: "/", - headers: { - "Content-Type": "application/x-www-form-urlencoded" - }, - requireHeaders: [ - "Content-Length" - ], - body: "Action=OffsetDatetimes&Version=2020-01-08&datetime=2019-12-17T00%3A48%3A18%2B01%3A00", - bodyMediaType: "application/x-www-form-urlencoded", - params: { - datetime: 1576540098, - } - }, -]) - -structure OffsetDatetimesInput { - datetime: DateTime -} diff --git a/smithy-aws-protocol-tests/model/awsQuery/main.smithy b/smithy-aws-protocol-tests/model/awsQuery/main.smithy index d75435a83ef..8ee0c6f5abd 100644 --- a/smithy-aws-protocol-tests/model/awsQuery/main.smithy +++ b/smithy-aws-protocol-tests/model/awsQuery/main.smithy @@ -64,6 +64,5 @@ service AwsQuery { HostWithPathOperation, DatetimeOffsets, - OffsetDatetimes, ] } diff --git a/smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy index 023c75bdfc3..f698b7bb1b9 100644 --- a/smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy +++ b/smithy-aws-protocol-tests/model/ec2Query/datetime-offsets.smithy @@ -56,55 +56,3 @@ apply DatetimeOffsets @httpResponseTests([ structure DatetimeOffsetsOutput { datetime: DateTime } - -// These tests are for verifying the server can correctly parse -// the `DateTime` timestamp with an offset -@tags(["server-only"]) -operation OffsetDatetimes { - input: OffsetDatetimesInput -} - -apply OffsetDatetimes @httpRequestTests([ - { - id: "Ec2QueryNegativeOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: ec2Query, - method: "POST", - uri: "/", - headers: { - "Content-Type": "application/x-www-form-urlencoded" - }, - requireHeaders: [ - "Content-Length" - ], - body: "Action=OffsetDatetimes&Version=2020-01-08&Datetime=2019-12-16T22%3A48%3A18-01%3A00", - bodyMediaType: "application/x-www-form-urlencoded", - params: { - datetime: 1576540098, - } - }, - { - id: "Ec2QueryPositiveOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: ec2Query, - method: "POST", - uri: "/", - headers: { - "Content-Type": "application/x-www-form-urlencoded" - }, - requireHeaders: [ - "Content-Length" - ], - body: "Action=OffsetDatetimes&Version=2020-01-08&Datetime=2019-12-17T00%3A48%3A18%2B01%3A00", - bodyMediaType: "application/x-www-form-urlencoded", - params: { - datetime: 1576540098, - } - }, -]) - -structure OffsetDatetimesInput { - datetime: DateTime -} diff --git a/smithy-aws-protocol-tests/model/ec2Query/main.smithy b/smithy-aws-protocol-tests/model/ec2Query/main.smithy index 99cc381f44f..d10fc421c91 100644 --- a/smithy-aws-protocol-tests/model/ec2Query/main.smithy +++ b/smithy-aws-protocol-tests/model/ec2Query/main.smithy @@ -80,6 +80,5 @@ service AwsEc2 { HostWithPathOperation, DatetimeOffsets, - OffsetDatetimes, ] } diff --git a/smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy index dd21a7e1e1e..0738daa043d 100644 --- a/smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/datetime-offsets.smithy @@ -53,52 +53,3 @@ apply DatetimeOffsets @httpResponseTests([ structure DatetimeOffsetsOutput { datetime: DateTime } - -// These tests are for verifying the server can correctly parse -// the `DateTime` timestamp with an offset -@tags(["server-only"]) -@http(uri: "/OffsetDatetimes", method: "POST") -operation OffsetDatetimes { - input: OffsetDatetimesInput -} - -apply OffsetDatetimes @httpRequestTests([ - { - id: "RestJsonNegativeOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: restJson1, - method: "POST", - uri: "/OffsetDatetimes", - body: - """ - { - "datetime": "2019-12-16T22:48:18-01:00" - } - """, - params: { datetime: 1576540098 } - bodyMediaType: "application/json", - appliesTo: "server" - }, - { - id: "RestJsonPositiveOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: restJson1, - method: "POST", - uri: "/OffsetDatetimes", - body: - """ - { - "datetime": "2019-12-17T00:48:18+01:00" - } - """, - params: { datetime: 1576540098 } - bodyMediaType: "application/json", - appliesTo: "server" - } -]) - -structure OffsetDatetimesInput { - datetime: DateTime -} diff --git a/smithy-aws-protocol-tests/model/restJson1/main.smithy b/smithy-aws-protocol-tests/model/restJson1/main.smithy index b248c1a33d3..8d2647ecf8b 100644 --- a/smithy-aws-protocol-tests/model/restJson1/main.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/main.smithy @@ -139,6 +139,5 @@ service RestJson { TestNoPayload, DatetimeOffsets, - OffsetDatetimes ] } diff --git a/smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy b/smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy index 0ee13974a98..5a005d564d0 100644 --- a/smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy +++ b/smithy-aws-protocol-tests/model/restXml/datetime-offsets.smithy @@ -55,64 +55,3 @@ apply DatetimeOffsets @httpResponseTests([ structure DatetimeOffsetsOutput { datetime: DateTime } - -// These tests are for verifying the server can correctly parse -// the `DateTime` timestamp with an offset -@tags(["server-only"]) -@http(uri: "/OffsetDatetimes", method: "POST") -operation OffsetDatetimes { - input: OffsetDatetimesInput -} - -apply OffsetDatetimes @httpRequestTests([ - { - id: "RestXmlNegativeOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: restXml, - method: "POST", - uri: "/OffsetDatetimes", - body: """ - - 2019-12-17T00:48:18+01:00 - - """, - bodyMediaType: "application/xml", - headers: { - "Content-Type": "application/xml" - }, - requireHeaders: [ - "Content-Length" - ], - params: { - datetime: 1576540098, - } - }, - { - id: "RestXmlPositiveOffsetDatetimes", - documentation: """ - Ensures that servers can correctly parse datetime (timestamps) with offsets""", - protocol: restXml, - method: "POST", - uri: "/OffsetDatetimes", - body: """ - - 2019-12-16T22:48:18-01:00 - - """, - bodyMediaType: "application/xml", - headers: { - "Content-Type": "application/xml" - }, - requireHeaders: [ - "Content-Length" - ], - params: { - datetime: 1576540098, - } - }, -]) - -structure OffsetDatetimesInput { - datetime: DateTime -} diff --git a/smithy-aws-protocol-tests/model/restXml/main.smithy b/smithy-aws-protocol-tests/model/restXml/main.smithy index 5db88318723..2c24158d610 100644 --- a/smithy-aws-protocol-tests/model/restXml/main.smithy +++ b/smithy-aws-protocol-tests/model/restXml/main.smithy @@ -94,6 +94,5 @@ service RestXml { EndpointWithHostLabelHeaderOperation, DatetimeOffsets, - OffsetDatetimes, ] }