Repository navigation
v0.4.0
Highlights
- Installing
jsonbrings inmojoandsimdjsonand nothing else. The CPU path has no MAX dependency. GPU parsing is opt-in: importloadsfromjson.gpuand addmax-coreyourself, which is covered by the Modular Community License rather than by MIT. - JSONPath implements RFC 9535. Filters gained logical operators, parentheses, existence tests and root references. Unions work, so do Normalized Paths and the function extensions
length,count,match,searchandvalue.$[::-1]used to loop forever reading out of bounds, and every open-ended slice quietly dropped its last element. Both are fixed. - JSON Schema implements draft 2020-12.
$refresolves; it was ignored before, so any schema using one reported every document valid.patternruns a real I-Regexp engine rather than comparing literals.unevaluatedPropertiesandunevaluatedItemswork. - One JSON Pointer implementation replaces three that disagreed with each other. JSON Patch is atomic,
testcompares numbers by value and ignores member order, and operations fail where the RFC says they must. - I-JSON mode, through
ParserConfig.interoperable()(RFC 7493). Valuebehaves like a JSON value:len,in, iteration,items(),keys(),values(),__hash__, structural==,__setitem__,remove, negative indices, and raisingas_int()-style accessors alongside the non-raising ones.- Typed deserialization is roughly twice as quick on every shape, and telemetry serialization is down 30%.
Conformance
Every standard below is checked by a catalog or a suite that runs in pixi run tests-cpu, which is the CI test job on Linux and macOS. The known-gap lists are empty.
| Standard | Checks | Result |
|---|---|---|
| RFC 8259 JSON | 312 asserted, 35 informational | 0 unexpected failures |
| RFC 7493 I-JSON | 6 asserted | 0 unexpected failures |
| RFC 6901 JSON Pointer | 18 asserted | 0 unexpected failures |
| RFC 6902 JSON Patch | 27 asserted | 0 unexpected failures |
| RFC 7396 Merge Patch | 21 asserted, 3 informational | 0 unexpected failures |
| JSON Schema 2020-12 | 197 asserted | 0 failures, 44 of 44 keywords |
| RFC 9535 JSONPath | 80 tests | all pass |
| RFC 9485 I-Regexp | 32 tests | all pass |
Breaking changes
get(key)returnsOptional[Value]. It used to return the member's raw JSON text and raise when the key was absent; that behaviour is nowraw_member(key).==on containers compares structurally, ignoring member order and treating1and1.0as equal. It used to compare serialized text.loads[target="gpu"]andload[target="gpu"]move fromjsontojson.gpu, with the same signature. Addmax-coreto your dependencies.
Install
[dependencies]
json = { git = "https://github.com/ehsanmok/json.git", tag = "v0.4.0" }For GPU parsing add max-core = ">=26.5.0" and import from json.gpu. See json/gpu/LICENSE-GPU.md for what that licence asks of you.