Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable validation for non-object values to document members #4022

Merged
merged 1 commit into from Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-ParamValidator-72a79dfa.json
@@ -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
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.