Skip to content

Commit

Permalink
updated validateStructure to accept null and undefined values for par…
Browse files Browse the repository at this point in the history
…ams not described in the input shape (#3276)
  • Loading branch information
reillymarkowitz authored Jan 5, 2021
1 parent 73a2be5 commit 65b6aaa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/next-release/feature-ParamValidator-971ace5c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "ParamValidator",
"description": "Updated validateStructure to accept null and undefined values for params not described in the input shape"
}
2 changes: 1 addition & 1 deletion lib/param_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ AWS.ParamValidator = AWS.util.inherit({
if (memberShape !== undefined) {
var memberContext = [context, paramName].join('.');
this.validateMember(memberShape, paramValue, memberContext);
} else {
} else if (paramValue !== undefined && paramValue !== null) {
this.fail('UnexpectedParameter',
'Unexpected key \'' + paramName + '\' found in ' + context);
}
Expand Down
6 changes: 6 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 65b6aaa

Please sign in to comment.