Skip to content

Commit

Permalink
Add unbound operation validator for protocol tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kstich committed Oct 16, 2024
1 parent 5ec9e32 commit 2f7a352
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions smithy-aws-protocol-tests/model/awsJson1_0/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ service JsonRpc10 {
OperationWithDefaults,
OperationWithRequiredMembers,
OperationWithNestedStructure
OperationWithRequiredMembersWithDefaults
]
}
1 change: 1 addition & 0 deletions smithy-aws-protocol-tests/model/awsJson1_1/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ service JsonProtocol {
OperationWithOptionalInputOutput,
PutAndGetInlineDocuments,
JsonEnums,
JsonIntEnums
NullOperation,
SparseNullsOperation,
GreetingWithErrors,
Expand Down
3 changes: 3 additions & 0 deletions smithy-aws-protocol-tests/model/restJson1/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ service RestJson {

// @httpResponseCode tests
HttpResponseCode,
ResponseCodeRequired
ResponseCodeHttpFallback

// @streaming tests
StreamingTraits,
Expand Down Expand Up @@ -133,6 +135,7 @@ service RestJson {
MalformedTimestampBodyDateTime,
MalformedTimestampBodyHttpDate,
MalformedContentTypeWithoutBody,
MalformedContentTypeWithoutBodyEmptyInput
MalformedContentTypeWithBody,
MalformedContentTypeWithPayload,
MalformedContentTypeWithGenericString,
Expand Down
27 changes: 27 additions & 0 deletions smithy-aws-protocol-tests/model/shared-types.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 15 additions & 0 deletions smithy-protocol-tests/model/shared-types.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2f7a352

Please sign in to comment.