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

appendix_a.json is not I-JSON #2

Open
hildjj opened this issue Jun 5, 2018 · 1 comment
Open

appendix_a.json is not I-JSON #2

hildjj opened this issue Jun 5, 2018 · 1 comment

Comments

@hildjj
Copy link

hildjj commented Jun 5, 2018

appendix_a.json is not terribly interoperable; the big integers lose precision when parsed with ECMAscript's JSON.parse(). RFC 7493 specifies a set of interoperability constraints that would be useful here.

If backward-compatibility is desired, a new property code be added. Example:

  {
    "cbor": "O///////////",
    "hex": "3bffffffffffffffff",
    "roundtrip": true,
    "decoded": -18446744073709551616,
    "decoded2": {
       "type": "bigint",
       "value": "-18446744073709551616"
    }
  },

This still wouldn't be I-JSON compliant, but would allow systems that have the constraints noted there to use this without as many gyrations.

@nelsonxb
Copy link

Some parsers (the one I know of at the moment is the one in Nim's standard library) will just reject the whole file thanks to these massive numbers. I plan to submit a PR tonight that makes these tests use "diagnostic" rather than "decoded".

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

No branches or pull requests

2 participants