Skip to content

Commit

Permalink
Remove pattern from suppress trait entries
Browse files Browse the repository at this point in the history
The suppress trait contained a restrictive pattern trait that was
not present in validator ID definitions. This meant that validation
events could be suppressed in metadata suppressions (where there was
no pattern validation), but not using the `@suppress` trait. Adding
the pattern from the `@suppress` trait to validation event IDs at
this point has the potential to break existing models, so that is
not a desirable alternative.

Closes #987
  • Loading branch information
mtdowling committed Oct 19, 2022
1 parent b130116 commit c45d5db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,6 @@ structure hostLabel {}
/// Suppresses validation events by ID for a given shape.
@trait
list suppress {
@pattern("^[_a-zA-Z][A-Za-z0-9]*$")
@length(min: 1)
member: String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
[SUPPRESSED] smithy.example#List2$member: Members? Yuck! | ListMembersAreBadOkay
[SUPPRESSED] -: Unable to locate a validator named `UnknownValidator2` (Please ignore this) | UnknownValidator_UnknownValidator2
[WARNING] -: Unable to locate a validator named `UnknownValidator1` | UnknownValidator_UnknownValidator1
[SUPPRESSED] smithy.example#MyService: This is suppressed | SuppressedValidator
[SUPPRESSED] smithy.example#MyService: This is suppressed | SuppressedValidator.Foo
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata validators = [
{
// This one is suppressed.
name: "EmitEachSelector",
id: "SuppressedValidator",
id: "SuppressedValidator.Foo",
message: "This is suppressed",
severity: "WARNING",
configuration: {
Expand All @@ -43,11 +43,11 @@ metadata suppressions = [
reason: "Please ignore this",
},
{
id: "SuppressedValidator",
id: "SuppressedValidator.Foo",
namespace: "smithy.example.ignore.this.one", // matches nothing
},
{
id: "SuppressedValidator",
id: "SuppressedValidator.Foo",
namespace: "smithy.example"
},
]
Expand All @@ -60,6 +60,7 @@ service MyService {
operations: [GetFoo],
}

@suppress(["IgnoreMe.Too"])
operation GetFoo {
input: GetFooInput,
output: GetFooOutput
Expand Down

0 comments on commit c45d5db

Please sign in to comment.