Skip to content

Timestamp Parsing Error Trying to List Operators #19

Description

@FE-hallen

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions