Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally allow numeric over- and under-flows #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

escherba
Copy link

Although JSON specification does not set any limits on how large
(or small) JSON numeric values can be, JSONKit throws an error
when it encounters numbers that are too large to represent on a
given system. This is may be an undesirable behavior when dealing
with some web-service providers that may, for example, return very
large TTL values (to represent non-expiring timestamps) or metrics
that are very close to zero and could be easily represented as such.

JKParseOptionTruncateNumbers is a parse option introduced here that,
when set, causes parser to ignore overflow-related numeric errors.
When this option is not set, the parser behaves in a normal way.

Although JSON specification does not set any limits on how large
(or small) JSON numeric values can be, JSONKit throws an error
when it encounters numbers that are too large to represent on a
given system. This is undesirable behavior when dealing with some
web-service providers that may, for example, return very large TTL
values (to represent non-expiring timestamps) or metrics that are
very close to zero and could be easily represented as such.

JKParseOptionTruncateNumbers is a parse option introduced here that,
when set, causes parser to ignore overflow-related numeric errors.
When this option is not set, the parser behaves in a normal way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant