Closed terrettazmaxime closed 1 year ago
Hi @terrettazmaxime
Thank you for bringing this issue to our attention. I am glad that you are using our latest Java library version.
A similar issue was previously reported by another user regarding Purolator returning an array in the error message. In response, we implemented a guard clause in our client libraries to handle such edge cases during error deserialization.
Regarding your reported issue, we have created an internal task to investigate whether this issue is occurring at the API level. If it is found to be the case, we will patch the issue at the API level, rather than making changes in all seven client libraries. We will keep you informed of any updates on this matter.
Thank you again for your valuable feedback.
@jchen293 Do you have any EAT for a fix, this is currently breaking our elements using Purolator.
Hello @terrettazmaxime , I've left a comment on your PR #240. If you can address the feedback, we can proceed with merging the PR. Please let me know if you would like me to take care of the rest of the PR.
Hello @jchen293 , I will appreciate if you can handle the PR and move this forward.
@terrettazmaxime I have opened PR #242 for this issue and it's waiting for reviews, I will let you know when we make a release. Thanks for reporting this issue again!
@terrettazmaxime I have merged PR #242 to handle these edge cases when deserializing error JSON, we are planning to release it tomorrow. Stay tuned and thanks for reporting this issue again!
Software Version
6.3.0
Language Version
11
Operating System
Linux
What happened?
We have noticed a bug in the software that occurs every time there is a validation errors when performing a One-Call Buy Shipment with Purolator and they return multiple validation errors. The bug is related to the deserialization of the JSON errors, which is not functioning as expected. Specifically, we have identified that when your code is deserializing the error node, it expects the message to be either a string or an array, but in this case, it is an object, it cashes in your internal code, and we do not get an EasyPostException. This issue is causing us significant trouble as we are currently unable to move forward with our production process.
I have included the JSON that is causing the problem below, as an example:
Code of your Error class package com.easypost.model;
When your deserializer, do the work, the message node is not a string, neither an array but and object and it crash.
What was expected?
The library to return a EasyPostException and beeing able to parse Errors correctly.
Sample Code
No response
Relevant logs