Skip to content

Commit

Permalink
feat(codegen): enable SSDK validation protocol tests (#2884)
Browse files Browse the repository at this point in the history
As a separate set of models from malformed request tests, Smithy publishes
malformed request tests for built-in validation, which exercises how the SSDK
rejects requests that do not obey the modeled constraints (such as length,
pattern, etc).
  • Loading branch information
adamthom-amzn authored Oct 13, 2021
1 parent 820e7a2 commit c23cbc4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions codegen/protocol-test-codegen/smithy-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@
}
}
},
"aws-restjson-validation": {
"transforms": [
{
"name": "includeServices",
"args": {
"services": ["aws.protocoltests.restjson.validation#RestJsonValidation"]
}
}
],
"plugins": {
"typescript-ssdk-codegen": {
"package": "@aws-sdk/aws-restjson-validation-server",
"packageVersion": "1.0.0-alpha.1"
}
}
},
"aws-restxml": {
"transforms": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,16 @@ private static boolean filterMalformedRequestTests(
return true;
}

//TODO: reenable when the SSDK uses RE2 and not built-in regex for pattern constraints
if (testCase.getId().equals("RestJsonMalformedPatternReDOSString")) {
return true;
}
//TODO: broken in Smithy 1.12.0, remove after next Smithy release
if (testCase.getId().equals("RestJsonMalformedLengthBlobOverride_case1")
|| testCase.getId().equals("RestJsonMalformedRequiredQueryNoValue")) {
return true;
}

return false;
}
}

0 comments on commit c23cbc4

Please sign in to comment.