From 2b76467a471cc903dc99d2af2f2433af1b86b0eb 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/aws-config.smithy | 27 +++++++++++++++++++ .../model/awsJson1_0/main.smithy | 1 + .../model/awsJson1_1/main.smithy | 1 + .../model/restJson1/main.smithy | 3 +++ .../model/shared-types.smithy | 15 +++++++++++ 5 files changed, 47 insertions(+) diff --git a/smithy-aws-protocol-tests/model/aws-config.smithy b/smithy-aws-protocol-tests/model/aws-config.smithy index 321956d6246..dc1de2c7da9 100644 --- a/smithy-aws-protocol-tests/model/aws-config.smithy +++ b/smithy-aws-protocol-tests/model/aws-config.smithy @@ -14,6 +14,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.config structure AwsConfig { 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-protocol-tests/model/shared-types.smithy b/smithy-protocol-tests/model/shared-types.smithy index 5340018ccd6..6bef8266e97 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 AWS 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 {