Skip to content

Commit

Permalink
disable validation for non-object values to document members (#4022)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP authored Feb 14, 2022
1 parent d0ac8a3 commit c6ec522
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-ParamValidator-72a79dfa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "ParamValidator",
"description": "Fix the validation error when assign non-object values to member with document trait"
}
3 changes: 1 addition & 2 deletions lib/param_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ AWS.ParamValidator = AWS.util.inherit({
},

validateStructure: function validateStructure(shape, params, context) {
this.validateType(params, context, ['object'], 'structure');

if (shape.isDocument) return true;

this.validateType(params, context, ['object'], 'structure');
var paramName;
for (var i = 0; shape.required && i < shape.required.length; i++) {
paramName = shape.required[i];
Expand Down
21 changes: 15 additions & 6 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 c6ec522

Please sign in to comment.