JsonDataSource fails with large integer value

When using a JSON object with a large integer value, the application throws an error indicating that the integer is too large for an Int64 . How can I modify the code to handle large integers in JSON without encountering this error?

Error message:

java.lang.IllegalStateException: There is an error on reading the JSON. JSON integer 100000000000000000000 is too large or small for an Int64. Path 'invalidNumber', line 1, position 38.

Here is a snippet of the code where the error occurs:

String invalidJsonString = "{\"invalidNumber\":100000000000000000000}";

ByteArrayInputStream dsByteStream = new ByteArrayInputStream(
    invalidJsonString.getBytes(StandardCharsets.UTF_8));

JsonDataLoadOptions options = new JsonDataLoadOptions();
options.setSimpleValueParseMode(JsonSimpleValueParseMode.STRICT);

JsonDataSource dataSource = new JsonDataSource(dsByteStream, options);

I am using aspose-words version 24.1.

Thanks in advance.

@e12893 The exception is expected wince the integer value is too large. The maximum allowed value in int64 is 9223372036854775807. Probably we can read the value that cannot be parsed to int64 as string to prevent the exception. Is this acceptable for you?

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27584

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks for your quick response!

Would it be possible to handle numeric values larger than Int64 (or long) as a BigInteger (or BigDouble)?

@e12893 Thank you for your suggestion. I added it to the created issue.