TECH Signal 293
Your JSON Is Lying to You
When data crosses service or language boundaries via JSON, these silent transformations corrupt identifiers, monetary values, and other critical fields without throwing errors. Validation after parsing cannot recover lost precision, making these changes difficult to detect and debug in distributed systems.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Integers outside JavaScript's safe range (beyond 2^53 - 1) are rounded during parsing or serialization, silently changing values like database identifiers and account numbers.
Values with no JSON equivalent—undefined, NaN, Date objects, and BigInt—are either dropped, converted to null, coerced to strings, or cause a TypeError, rather than being preserved.
The JSON format's minimal grammar prioritizes portability over exact type preservation, so applications must define explicit wire representations for any data that cannot survive a round trip.
THE CLUSTER
↗