aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json/stringify.zig
AgeCommit message (Collapse)Author
2024-02-20json: make std.json.stringifyAlloc return a mutable slice (#19013)Techatrix
2023-12-28refact: rectifified a typo in docs of stringify.zigMarcius
2023-11-22std: remove meta.traitAndrew Kelley
In general, I don't like the idea of std.meta.trait, and so I am providing some guidance by deleting the entire namespace from the standard library and compiler codebase. My main criticism is that it's overcomplicated machinery that bloats compile times and is ultimately unnecessary given the existence of Zig's strong type system and reference traces. Users who want this can create a third party package that provides this functionality. closes #18051
2023-08-08std.json: stringify enum literals (#16742)Philipp Lühmann
2023-08-06std.json: josh review fixesJonathan Marler
* renamed enum_big_numbers_quoted option to enum_nonportable_numbers_as_strings * updated stringify doc to mention the option I also reversed the logic to determine whether an integer is nonportable, it seemed easier to reason about. I also took a stab at applying the new option to floats, but, I got stuck at trying to print large floats, not sure if Zig supports that yet.
2023-08-06json.stringify: properly implement RFC8259 recommendationJacob Young
The previous magic numbers used `1 << 52`, which did not account for the implicit leading one in the floating point format. The RFC is correct when it uses an exponent of 53. Technically these exclusive endpoints are also representable, but everyone including the RFC seems to use them exclusively. Also, delete special case optimizations related to the type which have already been implemented in the zig compiler to produce comptime values for tautological runtime comparisons.
2023-08-05std.json: fix roundtrip stringify for large integersJonathan Marler
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.
2023-07-27std.json: WriteStream.print instead of writePreformattedJosh Wolfe
2023-07-22std.json.WriteStream: eliminate dead memory in optimized modes (#16485)Josh Wolfe
2023-07-21std.json: Unify stringify and writeStream (#16405)Josh Wolfe
2023-07-10explicitly specify error set of `std.json.stringify`Techatrix
2023-07-03json: give enums a default stringify implementationEvin Yulo
2023-07-03add docstring to std.json.stringify (#16241)yujiri8
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-05-13std: Rewrite low-level json api to support streaming (#15602)Josh Wolfe