Skip to content

Releases: whyisitworking/C-Simple-JSON-Parser

v3.0.0

Choose a tag to compare

@whyisitworking whyisitworking released this 27 Jun 13:55
f1669a0

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

Choose a tag to compare

@whyisitworking whyisitworking released this 27 Jun 12:30
03ebc12

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

Full Changelog: v2.3.2...v2.4.0

v2.3.2

Choose a tag to compare

@whyisitworking whyisitworking released this 22 Feb 08:53
3eec294

Removed warnings generated by compiling with -pedantic, -Wall & -Wextra.

v2.3.1

Choose a tag to compare

@whyisitworking whyisitworking released this 22 Sep 17:28
a597dd1

Fixed

  • Warnings

Breaking changes

  • JSON_SCRAPE_WHITESPACE changed to JSON_SKIP_WHITESPACE

v2.3

Choose a tag to compare

@whyisitworking whyisitworking released this 09 Oct 07:05
904a33f
  • Added differentiation between long and double for typed(json_number)
  • Fixed first example in README

v2.2

Choose a tag to compare

@whyisitworking whyisitworking released this 19 Jul 09:58
3a4ebff
  • Lookup elements from an object with keys

Full RFC-8259 compliance

Choose a tag to compare

@whyisitworking whyisitworking released this 10 Jul 17:44
a72edff

Changes

  • Null elements/entries are ignored correctly
  • Heterogeneous array support

v2.0.0

Choose a tag to compare

@whyisitworking whyisitworking released this 17 May 17:06

Complete revamp with multiple type support

Types

  • JSON_TYPE_STRING : String
  • JSON_TYPE_NUMBER : Number (Double)
  • JSON_TYPE_OBJECT : Object
  • JSON_TYPE_ARRAY : Array
  • JSON_TYPE_BOOLEAN : Boolean

Data structures

  • json_string_t
  • json_number_t
  • json_object_t
  • json_array_t
  • json_boolean_t