Skip to content

NumberFormatException in updateCustomerProfileV2 Due to Large ID Value #62

Description

@julianmican

Description:

When using the TalonOne SDK's updateCustomerProfileV2 method, the API response sometimes returns an ID value that exceeds the limit of an Integer. This results in a NumberFormatException, as the SDK expects an int, but the returned value is too large to be stored as such.

Error Details:

The following exception is thrown:


`java.lang.NumberFormatException: Expected an int but was 2298443835 at line 1 column 78 path $.customerProfile.id

at one.talon.JSON.deserialize ( one/talon/JSON.java:145 )
at one.talon.ApiClient.deserialize ( one/talon/ApiClient.java:835 )
at one.talon.ApiClient.handleResponse ( one/talon/ApiClient.java:1038 )
at one.talon.ApiClient.execute ( one/talon/ApiClient.java:965 )
at one.talon.api.IntegrationApi.updateCustomerProfileV2WithHttpInfo ( one/talon.api/IntegrationApi.java:3387 )
at one.talon.api.IntegrationApi.updateCustomerProfileV2 ( one/talon.api/IntegrationApi.java:3362 )
`

Root Cause:

In TalonOneJavaSdk/src/main/java/one/talon/model/CustomerSessionV2.java, the id field is defined as an Integer:

  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private Integer id;

Since an Integer in Java has a maximum value of 2,147,483,647, any value exceeding this limit (e.g., 2,298,443,835) causes a NumberFormatException.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions