Skip to content

Releases: ibireme/yyjson

Version 0.12.0

18 Aug 18:50
Compare
Choose a tag to compare

Added

  • Add yyjson_write_number() and yyjson_mut_write_number() to write a number value to a string buffer.
  • Add YYJSON_READ_ALLOW_EXT_NUMBER to support extended number formats, such as 0x7B, +.123.
  • Add YYJSON_READ_ALLOW_EXT_ESCAPE to support extended escape, such as \a, \0, \x7B.
  • Add YYJSON_READ_ALLOW_EXT_WHITESPACE to support extended whitespace, such as \v, \u2028.
  • Add YYJSON_READ_ALLOW_SINGLE_QUOTED_STR to support single-quoted strings, such as 'ab'.
  • Add YYJSON_READ_ALLOW_UNQUOTED_KEY to allow unquoted keys, such as {a:1,b:2}.
  • Add YYJSON_READ_JSON5 to enable full JSON5 support.

Changed

  • Removed support for non-standard JSON in the incremental reader yyjson_incr_read().

Version 0.11.1

13 May 17:49
9e24d6b
Compare
Choose a tag to compare

Fixed

  • Fix errors when unaligned access is disallowed (no impact if your build was already successful).

Version 0.11.0

05 May 17:37
484aefb
Compare
Choose a tag to compare

Added

  • Add YYJSON_READ_ALLOW_BOM flag to allow UTF-8 BOM.
  • Add YYJSON_WRITE_FP_TO_FLOAT flag to write real numbers using single-precison.
  • Add YYJSON_WRITE_FP_TO_FIXED(prec) flag to write real numbers using fix-point notation.
  • Add set_fp_to_float() and set_fp_to_fixed() functions to control the output format of a specific number.
  • Add set_str_noesc() function to skip escaping for a specific string during writing.
  • Add yyjson_incr_read(), yyjson_incr_new(), yyjson_incr_free() functions for incremental DOM reading.

Changed

  • Rewrite the floating-point number to string functions with a new fast path.
  • When comments are allowed, return UNEXPECTED_END instead of INVALID_COMMENT for unclosed comments.
  • Truncated escape sequences now report the error position at the sequence start rather than the end.

Fixed

  • Fix some warnings when directly including yyjson.c: #177
  • Fix missing indent for YYJSON_TYPE_RAW in prettify function: #178
  • Fix bug in yyjson_mut_arr_iter_remove(): #194
  • Fix clang 19 documentation warnings.
  • Fix cmake 4 and cmake 3.5 warnings.

Version 0.10.0

09 Jul 16:34
9ddba00
Compare
Choose a tag to compare

Added

  • Add yyjson_locate_pos() function to locate the line and column number for error position: #166

Changed

  • Improve error messages for JSON reader: #168

Fixed

  • Fix YYJSON_READ_NUMBER_AS_RAW not overriding YYJSON_READ_BIGNUM_AS_RAW as per documentation: #170

Version 0.9.0

08 Apr 15:08
b21c029
Compare
Choose a tag to compare

Added

  • Add YYJSON_WRITE_NEWLINE_AT_END flag for JSON writer: #147

Changed

  • Add auto-type conversion (uint<->sint) to yyjson_ptr_get_uint/sint(): #152

Fixed

  • Fix incorrect output in environments lacking native bool type support: #161

Version 0.8.0

13 Sep 17:19
e01ae9d
Compare
Choose a tag to compare

Added

  • Add YYJSON_SUBTYPE_NOESC subtype to mark strings that do not need to be escaped.
  • Add YYJSON_DISABLE_UTF8_VALIDATION flag to allow disabling UTF-8 validation at compile-time.
  • Add dynamic allocator API: yyjson_alc_dyn_new() and yyjson_alc_dyn_free().
  • Add the missing API yyjson_mut_obj_add_arr() and yyjson_mut_obj_add_obj(): #140

Changed

  • Improve the write performance of strings with YYJSON_SUBTYPE_NOESC.

Fixed

  • Fix clang-16 valgrind fail: #134
  • Fix compile break when both FAST_FP and READER are disabled

Version 0.7.0

25 May 14:24
09ccaa4
Compare
Choose a tag to compare

Added

  • Add YYJSON_WRITE_PRETTY_TWO_SPACES option to allow 2 spaces instead of 4 spaces when writing pretty JSON: #99
  • Add YYJSON_READ_BIGNUM_AS_RAW option to read big numbers as raw strings: #124
  • Add yyjson_get_num() function to convert and return any number value as double: #108
  • Add support for Loongarch: #112
  • Add functions to get type-specific values specified by JSON Pointer: #116
  • Add functions to read/write JSON with file pointer FILE *: #122
  • Add functions to support modifying memory pool size of yyjson_mut_doc.
  • Add convenience functions iter_with() for creating iterator.
  • Add functions to modify JSON using JSON Pointer, such as ptr_set() and ptr_remove().
  • Add support for JSON Patch (RFC 6902).

Changed

  • BREAKING CHANGE: Change the allocator's realloc function signature, add old_size parameter for custom allocator: #100
  • BREAKING CHANGE: Change yyjson_read_number() function, add alc parameter.
  • DEPRECATED: Deprecate get_pointer() functions, rename to ptr_get().
  • Improve performance of yyjson_mut_write() function.

Fixed

  • Fix inaccurate error code for truncated JSON: #103

Version 0.6.0

12 Dec 11:47
7b210d6
Compare
Choose a tag to compare

Added

  • Add functions to modify the content of a JSON value, for example yyjson_set_int(yyjson_val *val, int num).
  • Add functions to copy from mutable doc to immutable doc.
  • Add functions to support renaming an object's key.
  • Add the yyjson_read_number() function to parse numeric strings.
  • Add a placeholder allocator if yyjson_alc_pool_init() fails.

Fixed

  • Fix quite NaN on MIPS and HPPA arch.
  • Fixed compile error before GCC 4.5 which doesn't support empty optional extended asm label.
  • When built-in floating point conversion is disabled, sprintf() output for floating point numbers is missing a decimal point, for example 123 should be 123.0.

Version 0.5.1

17 Jun 14:40
c385651
Compare
Choose a tag to compare

Fixed

  • Fix run-time error when compiling as cpp and 32-bit (g++-5 -m32 -fPIC) #85
  • Fix incurrect output number format, remove unnecessary digits (e.g. 2.0e34 -> 2e34).

Version 0.5.0

25 May 19:58
dd17081
Compare
Choose a tag to compare

Added

  • Add LibFuzzer support.
  • Add Doxygen support.
  • Add functions to support serializing a single JSON value.
  • Add yyjson_mut_doc_mut_copy(), yyjson_mut_val_mut_copy(), yyjson_mut_merge_patch() function for mutable input.
  • Add yyjson_equals() and yyjson_mut_equals() function to compare two values.
  • Add yyjson_mut_obj_remove_key() and yyjson_mut_obj_remove_keyn() to make it easier to remove a key.
  • Add YYJSON_READ_NUMBER_AS_RAW option and RAW type support.
  • Add YYJSON_READ_ALLOW_INVALID_UNICODE and YYJSON_WRITE_ALLOW_INVALID_UNICODE options to allow invalid unicode.

Changed

  • Change yyjson_mut_obj_remove() return type from bool to yyjson_mut_val *.
  • Rewrite string serialization function, validate unicode encoding by default.
  • Rewrite the JSON Pointer implementation, remove internal malloc() calls.

Fixed

  • Make the code work correctly with setlocale() function and fast-math flag: #54
  • Fix negative infinity literals read error: #64
  • Fix non null-terminated string write error.
  • Fix incorrect behavior of YYJSON_DISABLE_NON_STANDARD flag: #80