# std.json: fix roundtrip stringify for large integers · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/7dacf7774523a454fce7216c13eb03c6badf8d7b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 7dacf7774523a454fce7216c13eb03c6badf8d7b

Requested commit: 7dacf7774523a454fce7216c13eb03c6badf8d7b

Commit: 7dacf7774523a454fce7216c13eb03c6badf8d7b

Tree: 4ae025fb9f546d09d3edeaada625dc89f880eca3

Author: Jonathan Marler

Committer: Jonathan Marler

## Message

```
std.json: fix roundtrip stringify for large integers

std.json follows interoperability recommendations from RFC8259 to limit
JSON number values to those that fit inside an f64.  However, since Zig
supports arbitrarily large JSON numbers, this breaks roundtrip data
congruence.

To appease both use cases, I've added an option `emit_big_numbers_quoted`
to StringifyOptions.  It's disabled by default which preserves roundtrip
but can be enabled to favor interoperability.

```

## Parents

- [68f84964b3d80e5b976810208a14c31268a181e1](https://git.cafe/gitcafe/zig/commit/68f84964b3d80e5b976810208a14c31268a181e1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/7dacf7774523a454fce7216c13eb03c6badf8d7b?format=markdown)
