Closed harshinim closed 1 year ago
Hi @harshinim. This error is avsc
protecting you from potentially invalid defaults in the parsed schema. The built-in JSON.parse
does not handle long integers:
> JSON.parse('9007199254740995')
9007199254740996
To work around this you can use a custom JSON parser (for example json-bigint
) to parse the schema. The only requirement from avsc
's side is that the long type emitted by the parser be compatible with your custom long type.
I have a backend that is returning a default value in the schema which is a very long integer. Custom long types has been implemented as per the below document
https://github.com/mtth/avsc/wiki/Advanced-usage#custom-long-types
I still get " invalid "long": 32503679999999000" error.