Skip to content

Commit

Permalink
fix ParamValidator failing on document trait (#4011)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Jan 21, 2022
1 parent fcf2555 commit bb7f346
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-ParamValidator-b021ee76.json
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "ParamValidator",
"description": "fix the issue that the ParamValidator always fails on the document trait"
}
2 changes: 2 additions & 0 deletions lib/param_validator.js
Expand Up @@ -53,6 +53,8 @@ AWS.ParamValidator = AWS.util.inherit({
validateStructure: function validateStructure(shape, params, context) {
this.validateType(params, context, ['object'], 'structure');

if (shape.isDocument) return true;

var paramName;
for (var i = 0; shape.required && i < shape.required.length; i++) {
paramName = shape.required[i];
Expand Down
11 changes: 11 additions & 0 deletions test/param_validator.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bb7f346

Please sign in to comment.