Closed LWhitakerEasypost closed 1 month ago
Thanks for bringing this to our attention. We are triaging this.
@LWhitakerEasypost Thanks for the Github Issue. DateDeserailizer was added for the Claims API which we launched two months ago, we have fixed the API level to ensure Z
always returns at the end of time format. So DateDeserailizer
is removed, you can update to v7.4.3 and that should fix the issue
Software Version
v7.4.2
Language Version
java 17.0.9 2023-10-17 LTS
Operating System
Locally macOS 14.6.1, deployed to kube-helm ECR img OS/Arch: Linux, x86-64, ARM 64
What happened?
I wanted to check how we can get the time portion of datetime fields like
created_at
andupdated_at
using the Java SDK (I understand that it could be done by calling the API directly).Right now, I saw that
Date
parsing comes from the GSON DateDeserializer, however the loop in the function below, always circuit-breaks at the first given DATE_FORMATS which is "yyyy-MM-dd" (and therefore ignoring the time portion when deserializing).When called from https://github.com/EasyPost/easypost-java/blob/master/src/main/java/com/easypost/http/Requestor.java#L618
As classes are final and instantiated, not injected, I didn't not find a straightforward way to override the behavior of this serializer. What do you suggest? For some fields like est_delivered_date, and tracker datetime we do need to capture the time portion.
What was expected?
The timestamp portion of the "datetime" would be captured and parsed correctly.
Sample Code
No response
Relevant logs
No response