Skip to content

Tags: ocaml-community/yojson

Tags

3.0.0

Toggle 3.0.0's commit message
Release 3.0.0

CHANGES:

*2025-05-39*

- Floats are now always output to JSON in a standard-conformant way or not at
  all (raising an exception). This makes the `std` variants of functions
  identical to the non-`std` variants and the `std` arguments have no effect.
  Users are encouraged to switch to the non-`std` affixed variants, the others
  will be deprecated in the future.  (#184, @Leonidas-from-XIV)
- Bumped the minimum required version of OCaml for the main package to 4.08
  since the CI dropped the support. This however allows removing the dependency
  on the `seq` library, so the depencency cone becomes slightly smaller. (#194,
  @Leonidas-from-XIV)

- Fixed handling of escape sequences in JSON5. Known escapes like \b will be
  properly unescaped and undefined escape sequences will unescape to the
  character itself as per spec (#187, @david-maison-TrustInSoft)
- Fixed tests failing on Windows due to disagreements with the length of an
  input channel and the text mode conversion (#192, @Leonidas-from-XIV)

- Removed support for Tuple and Variant in JSON. It was a non-standard
  extension that was rarely used, so this simplifies the Yojson types and the
  parser more standard-conforming (#105, #158, #185 @Leonidas-from-XIV)

2.2.2

Toggle 2.2.2's commit message
Release 2.2.2

CHANGES:

*2024-06-27*

- Add locations in the JSON5 parser error messages (@gcluzel, #182)

2.2.1

Toggle 2.2.1's commit message
Release 2.2.1

CHANGES:

*2024-06-04*

- Don't expose `Yojson_five` internals anymore (@Leonidas_from_XIV, #180)

2.2.0

Toggle 2.2.0's commit message
Release 2.2.0

CHANGES:

*2024-05-31*

- Added support for JSON5 (@dhilst, @gorm-issuu, @gertsonderby, #152)

- Remove CPPO dependency to make the Yojson installation lighter
  (@Leonidas-from-XIV, #175)

2.1.2

Toggle 2.1.2's commit message
Release 2.1.2

CHANGES:

*2023-11-23*

- Fix the error location reported in the exception. Regression in 2.1.1
  (reported by @johnridesabike, regression test by @ElectreAAS, fix by
  @Leonidas-from-XIV, #171, #172)

2.1.1

Toggle 2.1.1's commit message
Release 2.1.1

CHANGES:

*2023-10-10*

- Make `Basic`, `Safe` & `Raw` seperate compilation units that get exposed by
  the main module as suggested by @hhugo to enable JSOO to discard unused
  modules. No API changes should be observable. (#84, #167 @Leonidas-from-XIV)
- Removed forward refs in the parser to make dead-code elimination in JSOO
  better (#168, @hhugo)

2.1.0

Toggle 2.1.0's commit message
Release 2.1.0

CHANGES:

*2023-04-26*

- Add `Yojson.Raw.Util` module to provide combinators for extracting fields
  from `Yojson.Raw.t` values. (@tmcgilchrist, #163)

- Add `Util.path` function to recurse into an object through a list of keys.
  (@cuihtlauac, @Leonidas-from-XIV, #157)

2.0.2

Toggle 2.0.2's commit message
Release 2.0.2

CHANGES:

*2022-08-09*

- Expanded documentation of exceptions (@sim642, #148)

- Removed undocumented and unused functions `write_float_fast` and
  `write_std_float_fast` from `Yojson`, `Yojson.Basic` and `Yojson.Safe`
  (@sim642, #149)

- Fix out-of-bounds error occurring when parsing object field names
  with atdgen parsers using `map_ident` or `map_lexeme` (@mjambon, #150)

2.0.1

Toggle 2.0.1's commit message
Release 2.0.1

CHANGES:

*2022-06-28*

- Fix pretty-printing behavior for lists/objects inside lists (@c-cube
  #141, @mjambon #142)

2.0.0

Toggle 2.0.0's commit message
Release 2.0.0

CHANGES:

- Removed dependency on easy-format and removed `pretty_format` from
  `Yojson`, `Yojson.Basic`, `Yojson.Safe` and `Yojson.Raw`. (@c-cube, #90)
- Removed dependency on `biniou`, simplifying the chain of dependencies. This
  changes some APIs:
  * `Bi_outbuf.t` in signatures is replaced with `Buffer.t`
  * `to_outbuf` becomes `to_buffer` and `stream_to_outbuf` becomes
    `stream_to_buffer`
  (@Leonidas-from-XIV, #74, and @gasche, #132)
- Removed `yojson-biniou` library
- Removed deprecated `json` type aliasing type `t` which has been available
  since 1.6.0 (@Leonidas-from-XIV, #100).
- Removed `json_max` type (@Leonidas-from-XIV, #103)
- Removed constraint that the "root" value being rendered (via either
  `pretty_print` or `to_string`) must be an object or array. (@cemerick, #121)
- Removed `validate_json` as it only made sense if the type was called `json`.
  (@Leonidas-from-XIV, #137)

- Add an opam package `yojson-bench` to deal with benchmarks dependency
  (@tmcgilchrist, #117)
- Add a benchmark to judge the respective performance of providing a buffer vs
  letting Yojson create an internal (#134, @Leonidas-from-XIV)
- Add an optional `suf` keyword argument was added to functions that write
  serialized JSON, thus allowing NDJSON output. Most functions default to not
  adding any suffix except for `to_file` (#124, @panglesd) and functions
  writing sequences of values where the default is `\n` (#135,
  @Leonidas-from-XIV)

- The `stream_from_*` and `stream_to_*` functions now use a `Seq.t` instead of a
  `Stream.t`, and they are renamed into `seq_from_*` and `seq_to_*` (@gasche, #131).

- Avoid copying unnecessarily large amounts of strings when parsing (#85, #108,
  @Leonidas-from-XIV)
- Fix `stream_to_file` (#133, @tcoopman and @gasche)