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

valid_address attribute is pointing to a enum that has string values but lob api returns boolean #269

Open
rajubushanam opened this issue Aug 4, 2023 · 2 comments

Comments

@rajubushanam
Copy link

Summary

valid_address attribute on the verification response is pointing to an enum that returns string values as "true" or "false". But the lob api actually returns this field as a boolean. This is not causing any bug in the response but when this enum is being used to compare against the returned value, the types don't match.

Expected Behavior

valid_address enum should be returning boolean values for both the True and False enums.

Current Behavior

valid_address attribute is defined as an enum that returns string values.

Possible Solution

Update the following enum to return true and false instead of string values - https://github.com/lob/lob-typescript-sdk/blob/main/models/us-verification.ts#L186

Steps to Reproduce

No direct bug in the response but pointing to the api docs that show valid_address as a boolean.

Context (Environment)

We are utilizing the enum UsVerificationValidAddressEnum in our code to compare against the value returned from the response and the types dont match. This is not a blocker for us because we can replace the enum check with a boolean, but it would be nice to use the enum if possible.

@hershmire
Copy link

@lobot any update on this?

@joserocha3
Copy link

joserocha3 commented Aug 7, 2024

@lobot I am awaiting an update as well

doing this for now (my function returns a boolean):

  // valid_address is typed as UsVerificationValidAddressEnum/string, but we know it's a boolean, this is
  // a temporary solution until the issue is fixed
  // github issue: https://github.com/lob/lob-typescript-sdk/issues/269,
  if (typeof singleVerified.valid_address === 'boolean') {
    return singleVerified.valid_address as unknown as boolean
  }

  // This is the correct way to check if the address is valid, adding this in case the issue is fixed
  return singleVerified.valid_address === UsVerificationValidAddressEnum.True
}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants