From 2f7a3524c8abe4f1edc205b1ea668f461426be93 Mon Sep 17 00:00:00 2001 From: Kevin Stich Date: Wed, 16 Oct 2024 14:45:23 -0700 Subject: [PATCH] Add unbound operation validator for protocol tests --- .../model/awsJson1_0/main.smithy | 1 + .../model/awsJson1_1/main.smithy | 1 + .../model/restJson1/main.smithy | 3 +++ .../model/shared-types.smithy | 27 +++++++++++++++++++ .../model/shared-types.smithy | 15 +++++++++++ 5 files changed, 47 insertions(+) diff --git a/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy b/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy index 6204e414ebf..f7314548b3a 100644 --- a/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy +++ b/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy @@ -41,5 +41,6 @@ service JsonRpc10 { OperationWithDefaults, OperationWithRequiredMembers, OperationWithNestedStructure + OperationWithRequiredMembersWithDefaults ] } diff --git a/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy b/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy index fcd1c29c925..cafa9c9a663 100644 --- a/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy +++ b/smithy-aws-protocol-tests/model/awsJson1_1/main.smithy @@ -26,6 +26,7 @@ service JsonProtocol { OperationWithOptionalInputOutput, PutAndGetInlineDocuments, JsonEnums, + JsonIntEnums NullOperation, SparseNullsOperation, GreetingWithErrors, diff --git a/smithy-aws-protocol-tests/model/restJson1/main.smithy b/smithy-aws-protocol-tests/model/restJson1/main.smithy index e37c1cf55ba..aa0f1589ae3 100644 --- a/smithy-aws-protocol-tests/model/restJson1/main.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/main.smithy @@ -65,6 +65,8 @@ service RestJson { // @httpResponseCode tests HttpResponseCode, + ResponseCodeRequired + ResponseCodeHttpFallback // @streaming tests StreamingTraits, @@ -133,6 +135,7 @@ service RestJson { MalformedTimestampBodyDateTime, MalformedTimestampBodyHttpDate, MalformedContentTypeWithoutBody, + MalformedContentTypeWithoutBodyEmptyInput MalformedContentTypeWithBody, MalformedContentTypeWithPayload, MalformedContentTypeWithGenericString, diff --git a/smithy-aws-protocol-tests/model/shared-types.smithy b/smithy-aws-protocol-tests/model/shared-types.smithy index f53e7d453eb..e65bcc6541d 100644 --- a/smithy-aws-protocol-tests/model/shared-types.smithy +++ b/smithy-aws-protocol-tests/model/shared-types.smithy @@ -18,6 +18,33 @@ metadata suppressions = [ } ] +metadata validators = [ + { + name: "EmitEachSelector" + id: "UnboundTestOperation" + message: "This operation in the AWS protocol tests is not bound to a service." + namespaces: [ + // Overall protocol test suites. + "aws.protocoltests.json10" + "aws.protocoltests.json" + "aws.protocoltests.query" + "aws.protocoltests.ec2" + "aws.protocoltests.restjson.validation" + "aws.protocoltests.restjson" + "aws.protocoltests.restxml" + "aws.protocoltests.restxml.xmlns" + // Service specific test suites. + "com.amazonaws.apigateway" + "com.amazonaws.glacier" + "com.amazonaws.machinelearning" + "com.amazonaws.s3" + ] + configuration: { + "selector": "operation :not(< service)" + } + } +] + namespace aws.protocoltests.shared list StringList { diff --git a/smithy-protocol-tests/model/shared-types.smithy b/smithy-protocol-tests/model/shared-types.smithy index 5340018ccd6..ce555f11790 100644 --- a/smithy-protocol-tests/model/shared-types.smithy +++ b/smithy-protocol-tests/model/shared-types.smithy @@ -7,6 +7,21 @@ $version: "2.0" +metadata validators = [ + { + name: "EmitEachSelector" + id: "UnboundTestOperation" + message: "This operation in the Smithy protocol tests is not bound to a service." + namespaces: [ + // Overall protocol test suites. + "smithy.protocoltests.rpcv2Cbor" + ] + configuration: { + "selector": "operation :not(< service)" + } + } +] + namespace smithy.protocoltests.shared list StringList {