CyberSource / CyberSource/cybersource-rest-client-java
Error in deserialization of the error object
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 29
- Forks
- 50
- Avg merge
- 28m
- Merged PRs (30d)
- 1
Description
Hello, I am using version 0.0.61 in Maven and the following error returns when I try to deserialize the object. InlineResponse2011
The API response has the following structure:
{
"id": "81021704004",
"submitTimeUtc": "2024-02-12T19:42:59Z",
"status": "SUCCESS",
"registrationInformation": {
"mode": "COMPLETE",
"boardingPackageId": "15583004004"
},
.....
I think it is failing on the date according to the error:
Invalid format: "2024-02-12T19:57:46Z" is malformed at "T19:57:46Z"
at org.joda.time.format.DateTimeFormatter.parseLocalDateTime(DateTimeFormatter.java:900)
at org.joda.time.format.DateTimeFormatter.parseLocalDate(DateTimeFormatter.java:844)
at Invokers.LocalDateTypeAdapter.read(JSON.java:222)
at Invokers.LocalDateTypeAdapter.read(JSON.java:201)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.Gson.fromJson(Gson.java:963)
at com.google.gson.Gson.fromJson(Gson.java:928)
at com.google.gson.Gson.fromJson(Gson.java:877)
at Invokers.JSON.deserialize(JSON.java:103)
at Invokers.ApiClient.deserialize(ApiClient.java:1059)
at Invokers.ApiClient.handleResponse(ApiClient.java:1283)
at Invokers.ApiClient.execute(ApiClient.java:1203)
at Api.MerchantBoardingApi.postRegistrationWithHttpInfo(MerchantBoardingApi.java:305)
at Api.MerchantBoardingApi.postRegistration(MerchantBoardingApi.java:289)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the response using the payload shown and start at Invokers/JSON.java, especially LocalDateTypeAdapter.read around line 222. Trace how the API response's submitTimeUtc value is mapped during ApiClient.deserialize. Done means the reported response can be deserialized without the shown date-format exception, with the expected date handling confirmed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100