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

aws apiGateway event - make sure http request parameters have boolean value #8329

Merged
Merged
Changes from 1 commit
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
Expand Up @@ -14,7 +14,7 @@ module.exports = {
const requestParameters = {};
if (event.http.request && event.http.request.parameters) {
Object.entries(event.http.request.parameters).forEach(([key, value]) => {
requestParameters[key] = value.required === undefined ? value : value.required;
requestParameters[key] = _.isObject(value) ? value.required || false : value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think intention was to make it required by default when object form is used. So I believe it should be:

_.isObject(value)
  ? ((value.required != null) ? value.required : true)
  : value

});
}

Expand Down