aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json.zig
AgeCommit message (Collapse)Author
2023-09-13std.json: add fmt function (#17055)Jonathan Marler
Adds std.json.fmt which returns a std.fmt Formatter that formats any given value using std.json.stringify.
2023-07-21std.json: Unify stringify and writeStream (#16405)Josh Wolfe
2023-07-09std.json: add generic hash map that parses/stringifies with arbitrary string ↵Josh Wolfe
keys (#16366) * expose innerParseFromValue
2023-07-08std.json: expose innerParse and add .allocate option (#16312)Garrett
2023-06-25std: re-pub new json symbols in json.zigJosh Wolfe
2023-06-19std: Support user-provided jsonParse method. Unify json.Parser and ↵Josh Wolfe
json.parse* (#15705)
2023-05-13std: Rewrite low-level json api to support streaming (#15602)Josh Wolfe
2023-05-07convert s[start..start+len] to s[start..][0..len]dweiller
2023-04-30std: fix a bunch of typosLinus Groh
The majority of these are in comments, some in doc comments which might affect the generated documentation, and a few in parameter names - nothing that should be breaking, however.
2023-04-28update codebase to use `@memset` and `@memcpy`Andrew Kelley
2023-04-26std: @Vector support for std.json.parseJanne Hellsten
2023-04-07std.json: allow returning custom errors from custom stringifymateusz
2023-03-21std.json: support tuplesMarcus Ramse
2023-03-08std.json.stringify: support [*:0]const u8r00ster91
2023-03-08std.json.parseInternal: use switches instead of ifsr00ster91
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-02-13Merge pull request #14548 from schmee/std-json-fixesVeikka Tuominen
Some std.json fixes
2023-02-13std: support deserialising JSON strings containing escape seqences into ↵Leo Constantinides
sentinel slice
2023-02-04std.json: don't free struct default valuesJohn Schmidt
Closes https://github.com/ziglang/zig/issues/9509.
2023-02-04std.json: avoid dangling pointers in ValueTreeJohn Schmidt
Closes https://github.com/ziglang/zig/issues/5229.
2023-02-04std.json: fix parsing of structs with default value const pointersJohn Schmidt
2023-01-28std.json: check output and source lengths in `std.json`Jon-Eric Cook
2022-12-17std.builtin: rename Type.UnionField and Type.StructField's field_type to typer00ster91
2022-12-06remove most conditional compilation based on stage1Andrew Kelley
There are still a few occurrences of "stage1" in the standard library and self-hosted compiler source, however, these instances need a bit more careful inspection to ensure no breakage.
2022-11-29std.mem.Allocator: allow shrink to failAndrew Kelley
closes #13535
2022-09-20Sema: check pointer qualifiers before implicit castVeikka Tuominen
Closes #12881
2022-07-24std.json: expose encodeJsonString and encodeJsonStringCharsJonathan Marler
Expose 2 functions from std.json. These functions take a slice of bytes and forward them to a given writer as a JSON encoded string. The use case I have for this is in a custom JsonStringWriter. This writer takes data and automatically encodes it as JSON string characters and forwards it to an underlying writer. I use this JsonStringWriter in combination with std.fmt.format to go directly from a format string/arg pair to JSON. This way I don't have to format my string into a separate buffer first and encode it afterwards, which avoids the need to create a temporary buffer to hold the unencoded but formatted string.
2022-07-23std.json: Fix parsing of large numbersominitay
Numbers greater than about 2^53 are encoded as strings in JSON. std.json.parseInternal previously errored out in this condition.
2022-07-07std.json: move tests to json/test.zig fileAndrew Kelley
This accomplishes two things: * Works around #8442 by putting stage1-specific logic in to disable all the std.json tests. * Slightly reduces installation size of zig since std lib files ending in "test.zig" are excluded from being installed.
2022-06-29std.json: Support disabling indent (#11823)May B
Newline Delimited JSON (ndjson) expect compact json without newline inside its content Add None to StringfyOptions.indent and move newline writeByte inside StringfyOptions.outputIndent
2022-06-03std: update tests to stage2 semanticsVeikka Tuominen
2022-05-10std.json stringify fix object keys are always is stringsAndreas Reischuck
* extracted outputJsonString to avoid code duplication
2022-05-10std.json add stringify struct with string as arrayOfekShochat
2022-04-27std: use float builtins instead of std.mathAndrew Kelley
2022-03-08std.json: correctly handle sentinel terminated slicesBenjamin San Souci
2022-03-08deprecated TypeInfo in favor of TypeJonathan Marler
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-02-13std.json: fix compile error for comptime fieldssharpobject
This is covered by an existing test which was already failing.
2022-02-01stage2: remove anytype fields from the languageAndrew Kelley
closes #10705
2022-01-17std: add json.stringifyAllocMeghan Denny
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-11-16std/json: use bit-stack for nesting instead of large LLVM integer typeMarc Tiehuis
The stack has been adjusted so that instead of pushing to index 0 in the integer we push to the current end/index of the underlying integer. This means we don't require a shift for every limb after each push/pop and instead only require a mask/or and add/sub on a single element of the array. Fixes #5959.
2021-11-15Json Stringify option to not write out null optional fields (#8979)Chris Heyes
2021-11-09std.Thread.Mutex: change API to lock() and unlock()Andrew Kelley
This is a breaking change. Before, usage looked like this: ```zig const held = mutex.acquire(); defer held.release(); ``` Now it looks like this: ```zig mutex.lock(); defer mutex.unlock(); ``` The `Held` type was an idea to make mutexes slightly safer by making it more difficult to forget to release an aquired lock. However, this ultimately caused more problems than it solved, when any data structures needed to store a held mutex. Simplify everything by reducing the API down to the primitives: lock() and unlock(). Closes #8051 Closes #8246 Closes #10105
2021-09-19Update all ensureCapacity calls to the relevant non-deprecated versionRyan Liptak
2021-09-01std, compiler-rt: remove test names where applicableAndrew Kelley
Tests with no names are executed when using `zig test` regardless of the `--test-filter` used. Non-named tests should be used when simply importing unit tests from another file. This allows `zig test` to find all the appropriate tests, even when using `--test-filter`.
2021-09-01std: reorganization that allows new usingnamespace semanticsAndrew Kelley
The proposal #9629 is now accepted, usingnamespace stays but no longer puts identifiers in scope.
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-08-20std.json: Add support for recursive objects to std.json.parse (#9307)Dmitry Matveyev
* Add support for recursive objects to std.json.parse * Remove previously defined error set * Try with function which returns an error set * Don't analyze already inferred types * Add comptime to inferred_type parameter * Make ParseInternalError to accept only a single argument * Add public `ParseError` for `parse` function * Use error.Foo syntax for errors instead of a named error set * Better formatting * Update to latest code changes