Our current setup reuses the Error class to represent address verification errors. However, the Error class has a custom deserializer that is being called during typical JSON deserialization in our library. Hard-coded logic inside that deserializer was effectively causing deserialization of the hints for address verification to fail.
This PR introduces another custom deserializer, specifically for the AddressVerification class that handles deserializing address verification JSON without the Error deserializer getting in the way.
Closes #288
Testing
Improved existing unit test to verify that deserialization worked properly (that address verification details were not lost during deserialization)
Pull Request Type
Please select the option(s) that are relevant to this PR.
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)
Description
Our current setup reuses the
Error
class to represent address verification errors. However, theError
class has a custom deserializer that is being called during typical JSON deserialization in our library. Hard-coded logic inside that deserializer was effectively causing deserialization of the hints for address verification to fail.This PR introduces another custom deserializer, specifically for the
AddressVerification
class that handles deserializing address verification JSON without theError
deserializer getting in the way.Closes #288
Testing
Pull Request Type
Please select the option(s) that are relevant to this PR.