top of page

Can a Large Numeric Identifier Change During JSON Parsing?

Oct 23
3 min read
Preserve every identifier digit: Inspect the numeric range; Choose an exact representation; Verify the round trip.

An integration receives a long numeric identifier and returns a slightly different value. The request succeeds, the field is not blank and the number still looks plausible. The problem may be numeric precision rather than transport corruption.


JSON can express numeric values that a receiving runtime does not preserve exactly in its default number type. For a business identifier, changing even the final digit can point to a different record. Review the complete representation path instead of assuming valid JSON implies exact numeric identity.


Separate syntax from receiver capability


RFC 8259 allows implementations to limit numeric range and precision. It identifies a range of integers that widely used binary64 implementations can agree on exactly. A syntactically valid number outside that interoperable range needs an explicit handling contract.


For JavaScript Number, MDN documents the maximum safe integer as 9,007,199,254,740,991. Beyond the safe-integer range, distinct integer inputs are not guaranteed to remain distinguishable using that type.


This is not a claim that every larger integer is unrepresentable. The issue is the guarantee across the range and the operations used by the receiving system. Avoid a rule that accepts a value merely because one large example happens to round-trip.


Decide whether the field is an identifier


Ask what operations are meaningful for the value. If it identifies a project, event or external record, arithmetic may be irrelevant. A string representation can preserve its digits, provided both sides agree on the schema and validation.


Do not convert an identifier to a number simply because it contains only digits. The identifier preservation guide explains a related issue with leading zeros. Precision loss is another reason to distinguish identity from quantity.


If exact arithmetic is required, choose an exact numeric strategy supported throughout the stack. Document how values are serialized and deserialized; selecting an internal type alone does not define the wire representation.


Illustrative boundary fixture


A fictional integration test includes the strings 9007199254740991, 9007199254740992 and 9007199254740993. These are synthetic identifiers, not customer records. The expected output is the exact original digit sequence for each value.


The reviewer sends them through the actual parser, application layer, storage adapter and export path. A comparison occurs at each boundary so the first point of change can be located.


The test includes both the agreed string representation and a deliberately incorrect numeric representation. The latter should be rejected or handled under a documented exact-number rule, rather than silently normalized into another identifier.


Check interfaces that quietly coerce types


Inspect form inputs, spreadsheet exports, database drivers and logging tools. A service may preserve the identifier correctly while a browser view or intermediate report converts it to a floating-point value.


Verify the value used in links and lookup requests, not just the displayed text. Formatting can make a changed identifier look similar, especially when the interface truncates long values.


Keep the original serialized input available in a controlled test fixture. Comparing two values after both have undergone the same lossy conversion cannot prove that the source was preserved.


Define rejection and migration behavior


If an existing API changes the field from number to string, treat that as a contract change. Review consumers before deployment and provide an explicit transition plan. Do not assume every client will accept a new type automatically.


For already affected records, recover identifiers from an authoritative source rather than guessing the missing digit. Quarantine ambiguous matches. A plausible repair can connect the record to the wrong external entity.


Accept exactness end to end


Keep fixtures near the relevant boundary, including ordinary values and values outside the safe range. Verify equality of the intended representation after parsing, storage, retrieval and export.


Accept the integration when every supported identifier remains exact and unsupported representations fail visibly. A successful HTTP response is useful transport evidence, but the business requirement is that the same record identity survives the entire journey.


FutureOS is in prelaunch. Use this guide to prepare a concrete project discussion, and read the published introduction for the current project context.



Prepared with AI assistance for the FutureOS editorial series. Primary sources checked on October 23, 2026. Examples are illustrative; this article does not announce an available FutureOS feature or an independently reviewed assessment.

Recent Posts

See All

Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.
bottom of page