Extend the LosslessDto class with your own Dto classes to enable lossless parsing of JSON int64 values.
These are Java long numbers with values that are not supported by JavaScript's Number type.
The SDK uses the lossless-json library to parse all JSON numbers as LosslessNumber type.
This allows us to safely parse large numbers without losing precision.
Decorate fields with @Int64String or @BigIntValue to specify how known int64 JSON numbers should be parsed
— either as a string or a bigint.
Prior to Camunda 8.7, the REST API returned entity keys as int64 numbers. From 8.7, the broker returns them as strings. LosslessDtos are
used to normalise this difference. It can also be used to parse large numbers in headers and variables, enabling lossless parsing of
large numbers in applications that use the SDK.
Example
This example is a Dto class that handles two int64 fields, decoding one as a string and one as a bigint.
It also has a child Dto field and some normal fields.
The child Dto is parsed as a LosslessDto, so it can also have int64 fields. For more complex Dtos, see the implementations in the SDK.
Extend the
LosslessDto
class with your own Dto classes to enable lossless parsing of JSONint64
values. These are Javalong
numbers with values that are not supported by JavaScript'sNumber
type. The SDK uses the lossless-json library to parse all JSON numbers asLosslessNumber
type. This allows us to safely parse large numbers without losing precision. Decorate fields with@Int64String
or@BigIntValue
to specify how knownint64
JSON numbers should be parsed — either as a string or a bigint.Prior to Camunda 8.7, the REST API returned entity keys as
int64
numbers. From 8.7, the broker returns them as strings. LosslessDtos are used to normalise this difference. It can also be used to parse large numbers in headers and variables, enabling lossless parsing of large numbers in applications that use the SDK.Example
This example is a Dto class that handles two int64 fields, decoding one as a
string
and one as abigint
. It also has a child Dto field and some normal fields. The child Dto is parsed as aLosslessDto
, so it can also haveint64
fields. For more complex Dtos, see the implementations in the SDK.