Releases: whyisitworking/C-Simple-JSON-Parser
Release list
v3.0.0
This is a full rewrite. The library is now a single header — drop json.h into your project, include it, and you're done. json.c is gone.
Breaking change: V3 shares no API surface with V2. See MIGRATION.md for a full mapping.
What's new
Arena ownership. Everything the parser allocates lives in a single arena attached to json_root. One json_free(&root) releases the entire tree. No per-node cleanup, no leak risk.
Path expressions. Read nested values without walking the tree:
json_path_get_long(&root.value, "hits[0].score", &n);Byte-accurate errors. Every failure returns both a json_status and a zero-based byte offset pointing at the exact problem in the input.
Honest numbers. Source text is always preserved. as_double is always set. as_long and is_long are only set when the value is an integer that fits exactly in long — overflow is not an error.
Validate-only mode. Pass NULL for out to check syntax without building a DOM.
Custom allocators. Supply your own malloc/realloc/free via json_config.
Fixes
Closes #22, #23, #25, #26, #27, #28 — including four security issues (heap buffer overflows, segfault, type confusion) that affected V2's json.c, which no longer exists.
Verified
-std=c89 -pedantic -Wall -Wextra -Werror
-std=c89 ... -fsanitize=address,undefined
-std=c99 / -std=c11
v2.4.0
What's Changed
- Create SECURITY.md for security policy and reporting by @qiaozhiyi in #24
- Stop json_object_find from dereferencing empty hash buckets by @SAY-5 in #30
New Contributors
- @qiaozhiyi made their first contribution in #24
- @SAY-5 made their first contribution in #30
Full Changelog: v2.3.2...v2.4.0
v2.3.2
Removed warnings generated by compiling with -pedantic, -Wall & -Wextra.
v2.3.1
Fixed
- Warnings
Breaking changes
JSON_SCRAPE_WHITESPACEchanged toJSON_SKIP_WHITESPACE
v2.3
- Added differentiation between
longanddoublefortyped(json_number) - Fixed first example in README
v2.2
- Lookup elements from an object with keys
Full RFC-8259 compliance
Changes
- Null elements/entries are ignored correctly
- Heterogeneous array support
v2.0.0
Complete revamp with multiple type support
Types
JSON_TYPE_STRING: StringJSON_TYPE_NUMBER: Number (Double)JSON_TYPE_OBJECT: ObjectJSON_TYPE_ARRAY: ArrayJSON_TYPE_BOOLEAN: Boolean
Data structures
json_string_tjson_number_tjson_object_tjson_array_tjson_boolean_t