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

Timestamp Parsing Error Trying to List Operators #19

Open
FE-hallen opened this issue Sep 23, 2024 · 0 comments
Open

Timestamp Parsing Error Trying to List Operators #19

FE-hallen opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@FE-hallen
Copy link

Describe the bug

Trying to get Airtime Operators via the Java SDK is throwing an exception trying to parse promotion timestamps.

Expected Behavior

It should be able to parse whatever date the API is returning.

Current Behavior

It is throwing an error at some of the dates the API is returning.

com.fasterxml.jackson.databind.JsonMappingException: java.text.ParseException: Unparseable date: "2024-07-08T04:01:00Z" (through reference chain: software.reloadly.sdk.core.dto.response.Page["content"]->java.util.ArrayList[136]->software.reloadly.sdk.airtime.dto.response.Operator["promotions"]->java.util.HashSet[0]->software.reloadly.sdk.airtime.dto.response.Promotion["startDate"])

Steps to Reproduce

`var airtimeAPI = AirtimeAPI.builder()
.clientId("your-client-id")
.clientSecret("your-client-secret")
.environment(Environment.LIVE)
.build();

var filter = new OperatorFilter()
.includeBundles(true)
.includeData(true)
.includeFixedDenominationType(true)
.includePin(false)
.includeRangeDenominationType(true)
.includeSuggestedAmounts(true)
.includeSuggestedAmountsMap(true)
.withPage(1, 200);

var page = airtimeAPI.operators().list(filter).execute();`

Possible Solution

Switch the deserializer to use DateTimeFormatter with optional sections.

Context

We run a nightly import of Operators into our system to use throughout the day. This import has been failing for days now, so our Operator list is growing outdated.

Your Environment

  • Reloadly Java SDK version used:
  • JDK version used:
  • Operating System and version:

Reloadly SDK 1.0.2
Corretto 17
Amazon Linux 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant