Skip to content

Commit

Permalink
[FIX] Validates lambdaGetParameters param type (#275)
Browse files Browse the repository at this point in the history
* chore: bumps patch version

* fix: param has value if its from type boolee
  • Loading branch information
marcofeliponi authored Jul 12, 2024
1 parent 30cd1f7 commit e5533a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapcon-utils-js",
"version": "1.4.5",
"version": "1.4.6",
"description": "Utils library for Javascript",
"keywords": [],
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/lambda/lambdaGetParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const extractParams = (docfy: Docfy, parameter: string, evt: APIGatewayEvent) =>
const param = get(evt, `${parameter}.${key}`) ?? value.default

const hasParamValue = params[identity]
const hasValue = param && param !== 'undefined'
const hasValue = (param && param !== 'undefined') || typeof param === 'boolean'
const isRequired = value.required ?? parameter === 'pathParameters'

if (isRequired && !hasValue && !hasParamValue) {
Expand Down

0 comments on commit e5533a7

Please sign in to comment.