From 476a95ea8331b7dc5a320d0259726f0d14b48f03 Mon Sep 17 00:00:00 2001 From: Michael Dowling Date: Wed, 15 Jan 2020 10:24:45 -0800 Subject: [PATCH] Migrate protocol tests to new operation syntax --- .../smithy/query/empty-input-output.smithy | 11 +++++-- .../META-INF/smithy/query/input-lists.smithy | 4 ++- .../META-INF/smithy/query/input-maps.smithy | 4 ++- .../META-INF/smithy/query/input.smithy | 16 +++++++--- .../META-INF/smithy/query/xml-errors.smithy | 5 ++- .../META-INF/smithy/query/xml-lists.smithy | 4 ++- .../META-INF/smithy/query/xml-maps.smithy | 16 +++++++--- .../META-INF/smithy/query/xml-structs.smithy | 28 ++++++++++++----- .../rest-json/empty-input-output.smithy | 11 +++++-- .../META-INF/smithy/rest-json/errors.smithy | 5 ++- .../smithy/rest-json/http-headers.smithy | 15 +++++++-- .../smithy/rest-json/http-labels.smithy | 12 +++++-- .../smithy/rest-json/http-payload.smithy | 15 +++++++-- .../rest-json/http-prefix-headers.smithy | 5 ++- .../smithy/rest-json/http-query.smithy | 24 ++++++++++---- .../smithy/rest-json/json-lists.smithy | 5 ++- .../smithy/rest-json/json-maps.smithy | 5 ++- .../smithy/rest-json/json-structs.smithy | 25 ++++++++++++--- .../smithy/rest-xml/document-lists.smithy | 5 ++- .../smithy/rest-xml/document-maps.smithy | 20 +++++++++--- .../smithy/rest-xml/document-structs.smithy | 30 ++++++++++++++---- .../rest-xml/document-xml-attributes.smithy | 10 ++++-- .../smithy/rest-xml/empty-input-output.smithy | 11 +++++-- .../META-INF/smithy/rest-xml/errors.smithy | 5 ++- .../smithy/rest-xml/http-headers.smithy | 15 +++++++-- .../smithy/rest-xml/http-labels.smithy | 12 +++++-- .../smithy/rest-xml/http-payload.smithy | 31 ++++++++++++++----- .../rest-xml/http-prefix-headers.smithy | 5 ++- .../smithy/rest-xml/http-query.smithy | 24 ++++++++++---- .../smithy/aws/protocoltests/ModelTest.java | 8 +++-- 30 files changed, 297 insertions(+), 89 deletions(-) diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/empty-input-output.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/empty-input-output.smithy index 0e198fb6d08..b50c0f0f81d 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/empty-input-output.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/empty-input-output.smithy @@ -12,7 +12,7 @@ use smithy.test#httpResponseTests /// no request or response payload because the operation has no input or output. /// /// While this should be rare, code generators must support this. -operation NoInputAndNoOutput() +operation NoInputAndNoOutput {} apply NoInputAndNoOutput @httpRequestTests([ { @@ -44,7 +44,9 @@ apply NoInputAndNoOutput @httpResponseTests([ /// no request payload or response members. /// /// While this should be rare, code generators must support this. -operation NoInputAndOutput() -> NoInputAndOutputOutput +operation NoInputAndOutput { + input: NoInputAndOutputOutput +} apply NoInputAndOutput @httpRequestTests([ { @@ -78,7 +80,10 @@ structure NoInputAndOutputOutput {} /// no request or response members. /// /// While this should be rare, code generators must support this. -operation EmptyInputAndEmptyOutput(EmptyInputAndEmptyOutputInput) -> EmptyInputAndEmptyOutputOutput +operation EmptyInputAndEmptyOutput { + input: EmptyInputAndEmptyOutputInput, + output: EmptyInputAndEmptyOutputOutput +} apply EmptyInputAndEmptyOutput @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-lists.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-lists.smithy index f71d92bee07..3efe55172d2 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-lists.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-lists.smithy @@ -11,7 +11,9 @@ use aws.protocols.tests.shared#StringList use smithy.test#httpRequestTests /// This test serializes simple and complex lists. -operation QueryLists(QueryListsInput) +operation QueryLists { + input: QueryListsInput +} apply QueryLists @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-maps.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-maps.smithy index c4a670c1a38..ebea8ddf264 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-maps.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input-maps.smithy @@ -10,7 +10,9 @@ use aws.protocols.tests.shared#StringMap use smithy.test#httpRequestTests /// This test serializes simple and complex maps. -operation QueryMaps(QueryMapsInput) +operation QueryMaps { + input: QueryMapsInput +} apply QueryMaps @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input.smithy index 8fe2b0b4bc6..36ba8cc8525 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/input.smithy @@ -9,7 +9,9 @@ use aws.protocols.tests.shared#FooEnum use smithy.test#httpRequestTests /// This test serializes strings, numbers, and boolean values. -operation SimpleInputParams(SimpleInputParamsInput) +operation SimpleInputParams { + input: SimpleInputParamsInput +} apply SimpleInputParams @httpRequestTests([ { @@ -159,7 +161,9 @@ structure SimpleInputParamsInput { /// 1. Timestamps are serialized as RFC 3339 date-time values by default. /// 2. A timestampFormat trait on a member changes the format. /// 3. A timestampFormat trait on the shape targeted by the member changes the format. -operation QueryTimestamps(QueryTimestampsInput) +operation QueryTimestamps { + input: QueryTimestampsInput +} apply QueryTimestamps @httpRequestTests([ { @@ -201,7 +205,9 @@ structure QueryTimestampsInput { } /// This test serializes nested and recursive structure members. -operation NestedStructures(NestedStructuresInput) +operation NestedStructures { + input: NestedStructuresInput +} apply NestedStructures @httpRequestTests([ { @@ -244,7 +250,9 @@ structure StructArg { /// Automatically adds idempotency tokens. @tags(["client-only"]) -operation QueryIdempotencyTokenAutoFill(QueryIdempotencyTokenAutoFillInput) +operation QueryIdempotencyTokenAutoFill { + input: QueryIdempotencyTokenAutoFillInput +} apply QueryIdempotencyTokenAutoFill @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-errors.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-errors.smithy index 7ef69ba99f8..b50c37bd5fd 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-errors.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-errors.smithy @@ -34,7 +34,10 @@ use smithy.test#httpResponseTests /// 1. A successful response in the form of GreetingWithErrorsOutput /// 2. An InvalidGreeting error. /// 3. A BadRequest error. -operation GreetingWithErrors() -> GreetingWithErrorsOutput errors [InvalidGreeting, ComplexError] +operation GreetingWithErrors { + output: GreetingWithErrorsOutput, + errors: [InvalidGreeting, ComplexError] +} apply GreetingWithErrors @httpResponseTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-lists.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-lists.smithy index 16c5c624f61..30d3580b432 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-lists.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-lists.smithy @@ -23,7 +23,9 @@ use smithy.test#httpResponseTests /// 5. Flattened XML lists. /// 6. Flattened XML lists with @xmlName. /// 7. Lists of structures. -operation XmlLists() -> XmlListsOutput +operation XmlLists { + output: XmlListsOutput +} apply XmlLists @httpResponseTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-maps.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-maps.smithy index de144af7639..68494f8323b 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-maps.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-maps.smithy @@ -9,7 +9,9 @@ use aws.protocols.tests.shared#GreetingStruct use smithy.test#httpResponseTests /// The example tests basic map serialization. -operation XmlMaps() -> XmlMapsOutput +operation XmlMaps { + output: XmlMapsOutput +} apply XmlMaps @httpResponseTests([ { @@ -64,7 +66,9 @@ map XmlMapsOutputMap { } // This example tests maps with @xmlName on members. -operation XmlMapsXmlName() -> XmlMapsXmlNameOutput +operation XmlMapsXmlName { + output: XmlMapsXmlNameOutput +} apply XmlMapsXmlName @httpResponseTests([ { @@ -122,7 +126,9 @@ map XmlMapsXmlNameOutputMap { } /// Flattened maps -operation FlattenedXmlMap() -> FlattenedXmlMapOutput +operation FlattenedXmlMap { + output: FlattenedXmlMapOutput +} apply FlattenedXmlMap @httpResponseTests([ { @@ -162,7 +168,9 @@ structure FlattenedXmlMapOutput { } /// Flattened maps with @xmlName -operation FlattenedXmlMapWithXmlName() -> FlattenedXmlMapWithXmlNameOutput +operation FlattenedXmlMapWithXmlName { + output: FlattenedXmlMapWithXmlNameOutput +} apply FlattenedXmlMapWithXmlName @httpResponseTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-structs.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-structs.smithy index 0cf3e220151..f8ef9f742cc 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-structs.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/query/xml-structs.smithy @@ -12,7 +12,9 @@ use smithy.test#httpResponseTests // This example serializes simple scalar types in the top level XML document. // Note that headers are not serialized in the payload. -operation SimpleScalarXmlProperties() -> SimpleScalarXmlPropertiesOutput +operation SimpleScalarXmlProperties { + output: SimpleScalarXmlPropertiesOutput +} apply SimpleScalarXmlProperties @httpResponseTests([ { @@ -71,7 +73,9 @@ structure SimpleScalarXmlPropertiesOutput { } /// Blobs are base64 encoded -operation XmlBlobs() -> XmlBlobsOutput +operation XmlBlobs { + output: XmlBlobsOutput +} apply XmlBlobs @httpResponseTests([ { @@ -103,7 +107,9 @@ structure XmlBlobsOutput { /// This tests how timestamps are serialized, including using the /// default format of date-time and various @timestampFormat trait /// values. -operation XmlTimestamps() -> XmlTimestampsOutput +operation XmlTimestamps { + output: XmlTimestampsOutput +} apply XmlTimestamps @httpResponseTests([ { @@ -202,7 +208,9 @@ structure XmlTimestampsOutput { } /// This example serializes enums as top level properties, in lists, sets, and maps. -operation XmlEnums() -> XmlEnumsOutput +operation XmlEnums { + output: XmlEnumsOutput +} apply XmlEnums @httpResponseTests([ { @@ -265,7 +273,9 @@ structure XmlEnumsOutput { } /// Recursive shapes -operation RecursiveXmlShapes() -> RecursiveXmlShapesOutput +operation RecursiveXmlShapes { + output: RecursiveXmlShapesOutput +} apply RecursiveXmlShapes @httpResponseTests([ { @@ -327,7 +337,9 @@ structure RecursiveXmlShapesOutputNested2 { } // XML namespace -operation XmlNamespaces() -> XmlNamespacesOutput +operation XmlNamespaces { + output: XmlNamespacesOutput +} apply XmlNamespaces @httpResponseTests([ { @@ -390,7 +402,9 @@ list XmlNamespacedList { /// /// The wrapping element is always operation name + "Response", and /// inside of that wrapper is another wrapper named operation name + "Result". -operation IgnoresWrappingXmlName() -> IgnoresWrappingXmlNameOutput +operation IgnoresWrappingXmlName { + output: IgnoresWrappingXmlNameOutput +} apply IgnoresWrappingXmlName @httpResponseTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/empty-input-output.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/empty-input-output.smithy index 583949a94a3..260529444af 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/empty-input-output.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/empty-input-output.smithy @@ -14,7 +14,7 @@ use smithy.test#httpResponseTests /// no request or response payload because the operation has no input or output. /// While this should be rare, code generators must support this. @http(uri: "/NoInputAndNoOutput", method: "POST") -operation NoInputAndNoOutput() +operation NoInputAndNoOutput {} apply NoInputAndNoOutput @httpRequestTests([ { @@ -40,7 +40,9 @@ apply NoInputAndNoOutput @httpResponseTests([ /// output is empty. While this should be rare, code generators must support /// this. @http(uri: "/NoInputAndOutputOutput", method: "POST") -operation NoInputAndOutput() -> NoInputAndOutputOutput +operation NoInputAndOutput { + output: NoInputAndOutputOutput +} apply NoInputAndOutput @httpRequestTests([ { @@ -68,7 +70,10 @@ structure NoInputAndOutputOutput {} /// and empty output structure that reuses the same shape. While this should /// be rare, code generators must support this. @http(uri: "/EmptyInputAndEmptyOutput", method: "POST") -operation EmptyInputAndEmptyOutput(EmptyInputAndEmptyOutputInput) -> EmptyInputAndEmptyOutputOutput +operation EmptyInputAndEmptyOutput { + input: EmptyInputAndEmptyOutputInput, + output: EmptyInputAndEmptyOutputOutput +} apply EmptyInputAndEmptyOutput @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/errors.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/errors.smithy index 6d5f78574c6..cfab8cf3a68 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/errors.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/errors.smithy @@ -19,7 +19,10 @@ use smithy.test#httpResponseTests /// the presence of the @idempotent @http(uri: "/GreetingWithErrors", method: "PUT") -operation GreetingWithErrors() -> GreetingWithErrorsOutput errors [InvalidGreeting, ComplexError, FooError] +operation GreetingWithErrors { + output: GreetingWithErrorsOutput, + errors: [InvalidGreeting, ComplexError, FooError] +} apply GreetingWithErrors @httpResponseTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-headers.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-headers.smithy index cc17ad59863..d2dba773db4 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-headers.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-headers.smithy @@ -20,7 +20,10 @@ use smithy.test#httpResponseTests /// The example tests how requests and responses are serialized when there is /// no input or output payload but there are HTTP header bindings. @http(uri: "/InputAndOutputWithHeaders", method: "POST") -operation InputAndOutputWithHeaders(InputAndOutputWithHeadersIO) -> InputAndOutputWithHeadersIO +operation InputAndOutputWithHeaders { + input: InputAndOutputWithHeadersIO, + output: InputAndOutputWithHeadersIO +} apply InputAndOutputWithHeaders @httpRequestTests([ { @@ -260,7 +263,10 @@ structure InputAndOutputWithHeadersIO { /// Null and empty headers are not sent over the wire. @readonly @http(uri: "/NullAndEmptyHeaders", method: "GET") -operation NullAndEmptyHeaders(NullAndEmptyHeadersIO) -> NullAndEmptyHeadersIO +operation NullAndEmptyHeaders { + input: NullAndEmptyHeadersIO, + output: NullAndEmptyHeadersIO +} apply NullAndEmptyHeaders @httpRequestTests([ { @@ -308,7 +314,10 @@ structure NullAndEmptyHeadersIO { /// The example tests how timestamp request and response headers are serialized. @http(uri: "/TimestampFormatHeaders", method: "POST") -operation TimestampFormatHeaders(TimestampFormatHeadersIO) -> TimestampFormatHeadersIO +operation TimestampFormatHeaders { + input: TimestampFormatHeadersIO, + output: TimestampFormatHeadersIO +} apply TimestampFormatHeaders @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-labels.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-labels.smithy index 1e71e532089..c90a559e378 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-labels.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-labels.smithy @@ -14,7 +14,9 @@ use smithy.test#httpResponseTests /// payload but there are HTTP labels. @readonly @http(method: "GET", uri: "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}") -operation HttpRequestWithLabels(HttpRequestWithLabelsInput) +operation HttpRequestWithLabels { + input: HttpRequestWithLabelsInput +} apply HttpRequestWithLabels @httpRequestTests([ { @@ -77,7 +79,9 @@ structure HttpRequestWithLabelsInput { /// URI path. @readonly @http(method: "GET", uri: "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}") -operation HttpRequestWithLabelsAndTimestampFormat(HttpRequestWithLabelsAndTimestampFormatInput) +operation HttpRequestWithLabelsAndTimestampFormat { + input: HttpRequestWithLabelsAndTimestampFormatInput +} apply HttpRequestWithLabelsAndTimestampFormat @httpRequestTests([ { @@ -143,7 +147,9 @@ structure HttpRequestWithLabelsAndTimestampFormatInput { // This example uses a greedy label and a normal label. @readonly @http(method: "GET", uri: "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}") -operation HttpRequestWithGreedyLabelInPath(HttpRequestWithGreedyLabelInPathInput) +operation HttpRequestWithGreedyLabelInPath { + input: HttpRequestWithGreedyLabelInPathInput +} apply HttpRequestWithGreedyLabelInPath @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-payload.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-payload.smithy index 46d9e384f9b..3aebb20ca20 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-payload.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-payload.smithy @@ -14,7 +14,10 @@ use smithy.test#httpResponseTests /// In this example, no JSON document is synthesized because the payload is /// not a structure or a union type. @http(uri: "/HttpPayloadTraits", method: "POST") -operation HttpPayloadTraits(HttpPayloadTraitsInputOutput) -> HttpPayloadTraitsInputOutput +operation HttpPayloadTraits { + input: HttpPayloadTraitsInputOutput, + output: HttpPayloadTraitsInputOutput +} apply HttpPayloadTraits @httpRequestTests([ { @@ -89,7 +92,10 @@ structure HttpPayloadTraitsInputOutput { /// This examples uses a `@mediaType` trait on the payload to force a custom /// content-type to be serialized. @http(uri: "/HttpPayloadTraitsWithMediaType", method: "POST") -operation HttpPayloadTraitsWithMediaType(HttpPayloadTraitsWithMediaTypeInputOutput) -> HttpPayloadTraitsWithMediaTypeInputOutput +operation HttpPayloadTraitsWithMediaType { + input: HttpPayloadTraitsWithMediaTypeInputOutput, + output: HttpPayloadTraitsWithMediaTypeInputOutput +} apply HttpPayloadTraitsWithMediaType @httpRequestTests([ { @@ -142,7 +148,10 @@ structure HttpPayloadTraitsWithMediaTypeInputOutput { /// to match the targeted structure. @idempotent @http(uri: "/HttpPayloadWithStructure", method: "PUT") -operation HttpPayloadWithStructure(HttpPayloadWithStructureInputOutput) -> HttpPayloadWithStructureInputOutput +operation HttpPayloadWithStructure { + input: HttpPayloadWithStructureInputOutput, + output: HttpPayloadWithStructureInputOutput +} apply HttpPayloadWithStructure @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-prefix-headers.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-prefix-headers.smithy index 68d295ab7bb..0ac1aa295e5 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-prefix-headers.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-prefix-headers.smithy @@ -12,7 +12,10 @@ use smithy.test#httpResponseTests @readonly @http(uri: "/HttpPrefixHeaders", method: "GET") @externalDocumentation("https://awslabs.github.io/smithy/spec/http.html#httpprefixheaders-trait") -operation HttpPrefixHeaders(HttpPrefixHeadersInputOutput) -> HttpPrefixHeadersInputOutput +operation HttpPrefixHeaders { + input: HttpPrefixHeadersInputOutput, + output: HttpPrefixHeadersInputOutput +} apply HttpPrefixHeaders @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-query.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-query.smithy index 63c3db8a7ab..06f0b53bb52 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-query.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/http-query.smithy @@ -20,7 +20,9 @@ use smithy.test#httpResponseTests /// This example uses all query string types. @readonly @http(uri: "/AllQueryStringTypesInput", method: "GET") -operation AllQueryStringTypes(AllQueryStringTypesInput) +operation AllQueryStringTypes { + input: AllQueryStringTypesInput +} apply AllQueryStringTypes @httpRequestTests([ { @@ -168,7 +170,9 @@ structure AllQueryStringTypesInput { } }, ]) -operation ConstantQueryString(ConstantQueryStringInput) +operation ConstantQueryString { + input: ConstantQueryStringInput +} structure ConstantQueryStringInput { @httpLabel @@ -181,7 +185,9 @@ structure ConstantQueryStringInput { /// serialized (implementations may need to merge them together). @readonly @http(uri: "/ConstantAndVariableQueryString?foo=bar", method: "GET") -operation ConstantAndVariableQueryString(ConstantAndVariableQueryStringInput) +operation ConstantAndVariableQueryString { + input: ConstantAndVariableQueryStringInput +} apply ConstantAndVariableQueryString @httpRequestTests([ { @@ -232,7 +238,9 @@ structure ConstantAndVariableQueryStringInput { /// the request and response. @readonly @http(uri: "/IgnoreQueryParamsInResponse", method: "GET") -operation IgnoreQueryParamsInResponse() -> IgnoreQueryParamsInResponseOutput +operation IgnoreQueryParamsInResponse { + output: IgnoreQueryParamsInResponseOutput +} apply IgnoreQueryParamsInResponse @httpResponseTests([ { @@ -259,7 +267,9 @@ structure IgnoreQueryParamsInResponseOutput { /// Omits null, but serializes empty string value. @readonly @http(uri: "/OmitsNullSerializesEmptyString", method: "GET") -operation OmitsNullSerializesEmptyString(OmitsNullSerializesEmptyStringInput) +operation OmitsNullSerializesEmptyString { + input: OmitsNullSerializesEmptyStringInput +} apply OmitsNullSerializesEmptyString @httpRequestTests([ { @@ -290,7 +300,9 @@ structure OmitsNullSerializesEmptyStringInput { /// Automatically adds idempotency tokens. @http(uri: "/QueryIdempotencyTokenAutoFill", method: "POST") @tags(["client-only"]) -operation QueryIdempotencyTokenAutoFill(QueryIdempotencyTokenAutoFillInput) +operation QueryIdempotencyTokenAutoFill { + input: QueryIdempotencyTokenAutoFillInput +} apply QueryIdempotencyTokenAutoFill @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-lists.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-lists.smithy index 0b4804a4406..c71ba9a08cd 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-lists.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-lists.smithy @@ -25,7 +25,10 @@ use smithy.test#httpResponseTests /// 4. Lists of structures. @idempotent @http(uri: "/JsonLists", method: "PUT") -operation JsonLists(JsonListsInputOutput) -> JsonListsInputOutput +operation JsonLists { + input: JsonListsInputOutput, + output: JsonListsInputOutput +} apply JsonLists @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-maps.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-maps.smithy index b820fdd542a..aab66a0c94c 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-maps.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-maps.smithy @@ -11,7 +11,10 @@ use smithy.test#httpResponseTests /// The example tests basic map serialization. @http(uri: "/JsonMaps", method: "POST") -operation JsonMaps(JsonMapsInputOutput) -> JsonMapsInputOutput +operation JsonMaps { + input: JsonMapsInputOutput, + output: JsonMapsInputOutput +} apply JsonMaps @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-structs.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-structs.smithy index 5b4d022047e..269bb00c917 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-structs.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-json/json-structs.smithy @@ -16,7 +16,10 @@ use smithy.test#httpResponseTests // Note that headers are not serialized in the payload. @idempotent @http(uri: "/SimpleScalarProperties", method: "PUT") -operation SimpleScalarProperties(SimpleScalarPropertiesInputOutput) -> SimpleScalarPropertiesInputOutput +operation SimpleScalarProperties { + input: SimpleScalarPropertiesInputOutput, + output: SimpleScalarPropertiesInputOutput +} apply SimpleScalarProperties @httpRequestTests([ { @@ -116,7 +119,10 @@ structure SimpleScalarPropertiesInputOutput { /// Blobs are base64 encoded @http(uri: "/JsonBlobs", method: "POST") -operation JsonBlobs(JsonBlobsInputOutput) -> JsonBlobsInputOutput +operation JsonBlobs { + input: JsonBlobsInputOutput, + output: JsonBlobsInputOutput +} apply JsonBlobs @httpRequestTests([ { @@ -167,7 +173,10 @@ structure JsonBlobsInputOutput { /// default format of date-time and various @timestampFormat trait /// values. @http(uri: "/JsonTimestamps", method: "POST") -operation JsonTimestamps(JsonTimestampsInputOutput) -> JsonTimestampsInputOutput +operation JsonTimestamps { + input: JsonTimestampsInputOutput, + output: JsonTimestampsInputOutput +} apply JsonTimestamps @httpRequestTests([ { @@ -331,7 +340,10 @@ structure JsonTimestampsInputOutput { /// This example serializes enums as top level properties, in lists, sets, and maps. @idempotent @http(uri: "/JsonEnums", method: "PUT") -operation JsonEnums(JsonEnumsInputOutput) -> JsonEnumsInputOutput +operation JsonEnums { + input: JsonEnumsInputOutput, + output: JsonEnumsInputOutput +} apply JsonEnums @httpRequestTests([ { @@ -430,7 +442,10 @@ structure JsonEnumsInputOutput { /// Recursive shapes @idempotent @http(uri: "/RecursiveShapes", method: "PUT") -operation RecursiveShapes(RecursiveShapesInputOutput) -> RecursiveShapesInputOutput +operation RecursiveShapes { + input: RecursiveShapesInputOutput, + output: RecursiveShapesInputOutput +} apply RecursiveShapes @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-lists.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-lists.smithy index b678982786d..f155947b8d1 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-lists.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-lists.smithy @@ -28,7 +28,10 @@ use smithy.test#httpResponseTests /// 7. Lists of structures. @idempotent @http(uri: "/XmlLists", method: "PUT") -operation XmlLists(XmlListsInputOutput) -> XmlListsInputOutput +operation XmlLists { + input: XmlListsInputOutput, + output: XmlListsInputOutput, +} apply XmlLists @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-maps.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-maps.smithy index d40d0b94d05..e7f463be10b 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-maps.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-maps.smithy @@ -11,7 +11,10 @@ use smithy.test#httpResponseTests /// The example tests basic map serialization. @http(uri: "/XmlMaps", method: "POST") -operation XmlMaps(XmlMapsInputOutput) -> XmlMapsInputOutput +operation XmlMaps { + input: XmlMapsInputOutput, + output: XmlMapsInputOutput +} apply XmlMaps @httpRequestTests([ { @@ -107,7 +110,10 @@ map XmlMapsInputOutputMap { // This example tests maps with @xmlName on members. @http(uri: "/XmlMapsXmlName", method: "POST") -operation XmlMapsXmlName(XmlMapsXmlNameInputOutput) -> XmlMapsXmlNameInputOutput +operation XmlMapsXmlName { + input: XmlMapsXmlNameInputOutput, + output: XmlMapsXmlNameInputOutput +} apply XmlMapsXmlName @httpRequestTests([ { @@ -206,7 +212,10 @@ map XmlMapsXmlNameInputOutputMap { /// Flattened maps @http(uri: "/FlattenedXmlMap", method: "POST") -operation FlattenedXmlMap(FlattenedXmlMapInputOutput) -> FlattenedXmlMapInputOutput +operation FlattenedXmlMap { + input: FlattenedXmlMapInputOutput, + output: FlattenedXmlMapInputOutput +} apply FlattenedXmlMap @httpRequestTests([ { @@ -276,7 +285,10 @@ structure FlattenedXmlMapInputOutput { /// Flattened maps with @xmlName @http(uri: "/FlattenedXmlMapWithXmlName", method: "POST") -operation FlattenedXmlMapWithXmlName(FlattenedXmlMapWithXmlNameInputOutput) -> FlattenedXmlMapWithXmlNameInputOutput +operation FlattenedXmlMapWithXmlName { + input: FlattenedXmlMapWithXmlNameInputOutput, + output: FlattenedXmlMapWithXmlNameInputOutput +} apply FlattenedXmlMapWithXmlName @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-structs.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-structs.smithy index a8b7e772bea..7cdec41de38 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-structs.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-structs.smithy @@ -16,7 +16,10 @@ use smithy.test#httpResponseTests // Note that headers are not serialized in the payload. @idempotent @http(uri: "/SimpleScalarProperties", method: "PUT") -operation SimpleScalarProperties(SimpleScalarPropertiesInputOutput) -> SimpleScalarPropertiesInputOutput +operation SimpleScalarProperties { + input: SimpleScalarPropertiesInputOutput, + output: SimpleScalarPropertiesInputOutput +} apply SimpleScalarProperties @httpRequestTests([ { @@ -116,7 +119,10 @@ structure SimpleScalarPropertiesInputOutput { /// Blobs are base64 encoded @http(uri: "/XmlBlobs", method: "POST") -operation XmlBlobs(XmlBlobsInputOutput) -> XmlBlobsInputOutput +operation XmlBlobs { + input: XmlBlobsInputOutput, + output: XmlBlobsInputOutput +} apply XmlBlobs @httpRequestTests([ { @@ -169,7 +175,10 @@ structure XmlBlobsInputOutput { /// default format of date-time and various @timestampFormat trait /// values. @http(uri: "/XmlTimestamps", method: "POST") -operation XmlTimestamps(XmlTimestampsInputOutput) -> XmlTimestampsInputOutput +operation XmlTimestamps { + input: XmlTimestampsInputOutput, + output: XmlTimestampsInputOutput +} apply XmlTimestamps @httpRequestTests([ { @@ -341,7 +350,10 @@ structure XmlTimestampsInputOutput { /// This example serializes enums as top level properties, in lists, sets, and maps. @idempotent @http(uri: "/XmlEnums", method: "PUT") -operation XmlEnums(XmlEnumsInputOutput) -> XmlEnumsInputOutput +operation XmlEnums { + input: XmlEnumsInputOutput, + output: XmlEnumsInputOutput +} apply XmlEnums @httpRequestTests([ { @@ -454,7 +466,10 @@ structure XmlEnumsInputOutput { /// Recursive shapes @idempotent @http(uri: "/RecursiveShapes", method: "PUT") -operation RecursiveShapes(RecursiveShapesInputOutput) -> RecursiveShapesInputOutput +operation RecursiveShapes { + input: RecursiveShapesInputOutput, + output: RecursiveShapesInputOutput +} apply RecursiveShapes @httpRequestTests([ { @@ -559,7 +574,10 @@ structure RecursiveShapesInputOutputNested2 { // XML namespace @http(uri: "/XmlNamespaces", method: "POST") -operation XmlNamespaces(XmlNamespacesInputOutput) -> XmlNamespacesInputOutput +operation XmlNamespaces { + input: XmlNamespacesInputOutput, + output: XmlNamespacesInputOutput +} apply XmlNamespaces @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-xml-attributes.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-xml-attributes.smithy index b73816902d6..14c3482c880 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-xml-attributes.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/document-xml-attributes.smithy @@ -10,7 +10,10 @@ use smithy.test#httpResponseTests /// This example serializes an XML attributes on synthesized document. @idempotent @http(uri: "/XmlAttributes", method: "PUT") -operation XmlAttributes(XmlAttributesInputOutput) -> XmlAttributesInputOutput +operation XmlAttributes { + input: XmlAttributesInputOutput, + output: XmlAttributesInputOutput +} apply XmlAttributes @httpRequestTests([ { @@ -68,7 +71,10 @@ structure XmlAttributesInputOutput { /// This example serializes an XML attributes on a document targeted by httpPayload. @idempotent @http(uri: "/XmlAttributesOnPayload", method: "PUT") -operation XmlAttributesOnPayload(XmlAttributesOnPayloadInputOutput) -> XmlAttributesOnPayloadInputOutput +operation XmlAttributesOnPayload { + input: XmlAttributesOnPayloadInputOutput, + output: XmlAttributesOnPayloadInputOutput +} apply XmlAttributesOnPayload @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/empty-input-output.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/empty-input-output.smithy index 0d1f6bf32cf..17572428864 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/empty-input-output.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/empty-input-output.smithy @@ -12,7 +12,7 @@ use smithy.test#httpResponseTests /// no request or response payload because the operation has no input or output. /// While this should be rare, code generators must support this. @http(uri: "/NoInputAndNoOutput", method: "POST") -operation NoInputAndNoOutput() +operation NoInputAndNoOutput {} apply NoInputAndNoOutput @httpRequestTests([ { @@ -40,7 +40,9 @@ apply NoInputAndNoOutput @httpResponseTests([ /// output is empty. While this should be rare, code generators must support /// this. @http(uri: "/NoInputAndOutputOutput", method: "POST") -operation NoInputAndOutput() -> NoInputAndOutputOutput +operation NoInputAndOutput { + output: NoInputAndOutputOutput +} apply NoInputAndOutput @httpRequestTests([ { @@ -70,7 +72,10 @@ structure NoInputAndOutputOutput {} /// and empty output structure that reuses the same shape. While this should /// be rare, code generators must support this. @http(uri: "/EmptyInputAndEmptyOutput", method: "POST") -operation EmptyInputAndEmptyOutput(EmptyInputAndEmptyOutputInput) -> EmptyInputAndEmptyOutputOutput +operation EmptyInputAndEmptyOutput { + input: EmptyInputAndEmptyOutputInput, + output: EmptyInputAndEmptyOutputOutput +} apply EmptyInputAndEmptyOutput @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/errors.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/errors.smithy index 5b3a92926a5..4e759763e72 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/errors.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/errors.smithy @@ -18,7 +18,10 @@ use smithy.test#httpResponseTests /// the presence of the @idempotent @http(uri: "/GreetingWithErrors", method: "PUT") -operation GreetingWithErrors() -> GreetingWithErrorsOutput errors [InvalidGreeting, ComplexError] +operation GreetingWithErrors { + output: GreetingWithErrorsOutput, + errors: [InvalidGreeting, ComplexError] +} apply GreetingWithErrors @httpResponseTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-headers.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-headers.smithy index 414e4eef8b6..49d1f6f7568 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-headers.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-headers.smithy @@ -20,7 +20,10 @@ use smithy.test#httpResponseTests /// The example tests how requests and responses are serialized when there is /// no input or output payload but there are HTTP header bindings. @http(uri: "/InputAndOutputWithHeaders", method: "POST") -operation InputAndOutputWithHeaders(InputAndOutputWithHeadersIO) -> InputAndOutputWithHeadersIO +operation InputAndOutputWithHeaders { + input: InputAndOutputWithHeadersIO, + output: InputAndOutputWithHeadersIO +} apply InputAndOutputWithHeaders @httpRequestTests([ { @@ -260,7 +263,10 @@ structure InputAndOutputWithHeadersIO { /// Null and empty headers are not sent over the wire. @readonly @http(uri: "/NullAndEmptyHeaders", method: "GET") -operation NullAndEmptyHeaders(NullAndEmptyHeadersIO) -> NullAndEmptyHeadersIO +operation NullAndEmptyHeaders { + input: NullAndEmptyHeadersIO, + output: NullAndEmptyHeadersIO +} apply NullAndEmptyHeaders @httpRequestTests([ { @@ -308,7 +314,10 @@ structure NullAndEmptyHeadersIO { /// The example tests how timestamp request and response headers are serialized. @http(uri: "/TimestampFormatHeaders", method: "POST") -operation TimestampFormatHeaders(TimestampFormatHeadersIO) -> TimestampFormatHeadersIO +operation TimestampFormatHeaders { + input: TimestampFormatHeadersIO, + output: TimestampFormatHeadersIO +} apply TimestampFormatHeaders @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-labels.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-labels.smithy index 203a1e75ce0..51325da4a07 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-labels.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-labels.smithy @@ -14,7 +14,9 @@ use smithy.test#httpResponseTests /// payload but there are HTTP labels. @readonly @http(method: "GET", uri: "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}") -operation HttpRequestWithLabels(HttpRequestWithLabelsInput) +operation HttpRequestWithLabels { + input: HttpRequestWithLabelsInput +} apply HttpRequestWithLabels @httpRequestTests([ { @@ -77,7 +79,9 @@ structure HttpRequestWithLabelsInput { /// URI path. @readonly @http(method: "GET", uri: "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}") -operation HttpRequestWithLabelsAndTimestampFormat(HttpRequestWithLabelsAndTimestampFormatInput) +operation HttpRequestWithLabelsAndTimestampFormat { + input: HttpRequestWithLabelsAndTimestampFormatInput +} apply HttpRequestWithLabelsAndTimestampFormat @httpRequestTests([ { @@ -143,7 +147,9 @@ structure HttpRequestWithLabelsAndTimestampFormatInput { // This example uses a greedy label and a normal label. @readonly @http(method: "GET", uri: "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}") -operation HttpRequestWithGreedyLabelInPath(HttpRequestWithGreedyLabelInPathInput) +operation HttpRequestWithGreedyLabelInPath { + input: HttpRequestWithGreedyLabelInPathInput +} apply HttpRequestWithGreedyLabelInPath @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-payload.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-payload.smithy index 5372d6b0735..ff99b425c51 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-payload.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-payload.smithy @@ -14,7 +14,10 @@ use smithy.test#httpResponseTests /// In this example, no XML document is synthesized because the payload is /// not a structure or a union type. @http(uri: "/HttpPayloadTraits", method: "POST") -operation HttpPayloadTraits(HttpPayloadTraitsInputOutput) -> HttpPayloadTraitsInputOutput +operation HttpPayloadTraits { + input: HttpPayloadTraitsInputOutput, + output: HttpPayloadTraitsInputOutput +} apply HttpPayloadTraits @httpRequestTests([ { @@ -89,7 +92,10 @@ structure HttpPayloadTraitsInputOutput { /// This examples uses a `@mediaType` trait on the payload to force a custom /// content-type to be serialized. @http(uri: "/HttpPayloadTraitsWithMediaType", method: "POST") -operation HttpPayloadTraitsWithMediaType(HttpPayloadTraitsWithMediaTypeInputOutput) -> HttpPayloadTraitsWithMediaTypeInputOutput +operation HttpPayloadTraitsWithMediaType { + input: HttpPayloadTraitsWithMediaTypeInputOutput, + output: HttpPayloadTraitsWithMediaTypeInputOutput +} apply HttpPayloadTraitsWithMediaType @httpRequestTests([ { @@ -142,7 +148,10 @@ structure HttpPayloadTraitsWithMediaTypeInputOutput { /// to match the targeted structure. @idempotent @http(uri: "/HttpPayloadWithStructure", method: "PUT") -operation HttpPayloadWithStructure(HttpPayloadWithStructureInputOutput) -> HttpPayloadWithStructureInputOutput +operation HttpPayloadWithStructure { + input: HttpPayloadWithStructureInputOutput, + output: HttpPayloadWithStructureInputOutput +} apply HttpPayloadWithStructure @httpRequestTests([ { @@ -209,7 +218,10 @@ structure NestedPayload { /// changing the wrapper name. @idempotent @http(uri: "/HttpPayloadWithXmlName", method: "PUT") -operation HttpPayloadWithXmlName(HttpPayloadWithXmlNameInputOutput) -> HttpPayloadWithXmlNameInputOutput +operation HttpPayloadWithXmlName { + input: HttpPayloadWithXmlNameInputOutput, + output: HttpPayloadWithXmlNameInputOutput +} apply HttpPayloadWithXmlName @httpRequestTests([ { @@ -263,7 +275,10 @@ structure PayloadWithXmlName { /// The following example serializes a payload that uses an XML namespace. @idempotent @http(uri: "/HttpPayloadWithXmlNamespace", method: "PUT") -operation HttpPayloadWithXmlNamespace(HttpPayloadWithXmlNamespaceInputOutput) -> HttpPayloadWithXmlNamespaceInputOutput +operation HttpPayloadWithXmlNamespace { + input: HttpPayloadWithXmlNamespaceInputOutput, + output: HttpPayloadWithXmlNamespaceInputOutput +} apply HttpPayloadWithXmlNamespace @httpRequestTests([ { @@ -323,8 +338,10 @@ structure PayloadWithXmlNamespace { /// The following example serializes a payload that uses an XML namespace. @idempotent @http(uri: "/HttpPayloadWithXmlNamespaceAndPrefix", method: "PUT") -operation HttpPayloadWithXmlNamespaceAndPrefix(HttpPayloadWithXmlNamespaceAndPrefixInputOutput) - -> HttpPayloadWithXmlNamespaceAndPrefixInputOutput +operation HttpPayloadWithXmlNamespaceAndPrefix { + input: HttpPayloadWithXmlNamespaceAndPrefixInputOutput, + output: HttpPayloadWithXmlNamespaceAndPrefixInputOutput +} apply HttpPayloadWithXmlNamespaceAndPrefix @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-prefix-headers.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-prefix-headers.smithy index c8a05347958..2684076e173 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-prefix-headers.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-prefix-headers.smithy @@ -12,7 +12,10 @@ use smithy.test#httpResponseTests @readonly @http(uri: "/HttpPrefixHeaders", method: "GET") @externalDocumentation("https://awslabs.github.io/smithy/spec/http.html#httpprefixheaders-trait") -operation HttpPrefixHeaders(HttpPrefixHeadersInputOutput) -> HttpPrefixHeadersInputOutput +operation HttpPrefixHeaders { + input: HttpPrefixHeadersInputOutput, + output: HttpPrefixHeadersInputOutput +} apply HttpPrefixHeaders @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-query.smithy b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-query.smithy index e7cea5a5946..49ad8583e4f 100644 --- a/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-query.smithy +++ b/smithy-aws-protocol-tests/src/main/resources/META-INF/smithy/rest-xml/http-query.smithy @@ -20,7 +20,9 @@ use smithy.test#httpResponseTests /// This example uses all query string types. @readonly @http(uri: "/AllQueryStringTypesInput", method: "GET") -operation AllQueryStringTypes(AllQueryStringTypesInput) +operation AllQueryStringTypes { + input: AllQueryStringTypesInput +} apply AllQueryStringTypes @httpRequestTests([ { @@ -168,7 +170,9 @@ structure AllQueryStringTypesInput { } }, ]) -operation ConstantQueryString(ConstantQueryStringInput) +operation ConstantQueryString { + input: ConstantQueryStringInput +} structure ConstantQueryStringInput { @httpLabel @@ -181,7 +185,9 @@ structure ConstantQueryStringInput { /// serialized (implementations may need to merge them together). @readonly @http(uri: "/ConstantAndVariableQueryString?foo=bar", method: "GET") -operation ConstantAndVariableQueryString(ConstantAndVariableQueryStringInput) +operation ConstantAndVariableQueryString { + input: ConstantAndVariableQueryStringInput +} apply ConstantAndVariableQueryString @httpRequestTests([ { @@ -232,7 +238,9 @@ structure ConstantAndVariableQueryStringInput { /// the request and response. @readonly @http(uri: "/IgnoreQueryParamsInResponse", method: "GET") -operation IgnoreQueryParamsInResponse() -> IgnoreQueryParamsInResponseOutput +operation IgnoreQueryParamsInResponse { + output: IgnoreQueryParamsInResponseOutput +} apply IgnoreQueryParamsInResponse @httpResponseTests([ { @@ -259,7 +267,9 @@ structure IgnoreQueryParamsInResponseOutput { /// Omits null, but serializes empty string value. @readonly @http(uri: "/OmitsNullSerializesEmptyString", method: "GET") -operation OmitsNullSerializesEmptyString(OmitsNullSerializesEmptyStringInput) +operation OmitsNullSerializesEmptyString { + input: OmitsNullSerializesEmptyStringInput +} apply OmitsNullSerializesEmptyString @httpRequestTests([ { @@ -290,7 +300,9 @@ structure OmitsNullSerializesEmptyStringInput { /// Automatically adds idempotency tokens. @http(uri: "/QueryIdempotencyTokenAutoFill", method: "POST") @tags(["client-only"]) -operation QueryIdempotencyTokenAutoFill(QueryIdempotencyTokenAutoFillInput) +operation QueryIdempotencyTokenAutoFill { + input: QueryIdempotencyTokenAutoFillInput +} apply QueryIdempotencyTokenAutoFill @httpRequestTests([ { diff --git a/smithy-aws-protocol-tests/src/test/java/software/amazon/smithy/aws/protocoltests/ModelTest.java b/smithy-aws-protocol-tests/src/test/java/software/amazon/smithy/aws/protocoltests/ModelTest.java index 3d73e334039..0029dc72fbc 100644 --- a/smithy-aws-protocol-tests/src/test/java/software/amazon/smithy/aws/protocoltests/ModelTest.java +++ b/smithy-aws-protocol-tests/src/test/java/software/amazon/smithy/aws/protocoltests/ModelTest.java @@ -2,6 +2,7 @@ import org.junit.jupiter.api.Test; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.validation.ValidatedResult; /** * TODO: fix gradle plugin and remove this code. @@ -9,9 +10,10 @@ public class ModelTest { @Test public void loadsModel() { - Model.assembler() + ValidatedResult r = Model.assembler() .discoverModels() - .assemble() - .unwrap(); + .assemble(); + System.out.println(r.getValidationEvents()); + r.unwrap(); } }