JSON parsing and pretty-printing library for OCaml
OCaml Makefile Standard ML
Latest commit 705c655 Mar 1, 2016 @mjambon Version 1.3.2
Failed to load latest commit information.
examples Added exception-free filters Feb 27, 2012
.gitignore Install cmt/cmti/mli's Feb 21, 2016
.merlin Add .merlin Feb 21, 2016
Changes Fix the beginning-of-error cnum off-by-2 Apr 2, 2015
INSTALL Added INSTALL file. Sep 12, 2010
LICENSE Added license and version to ydump output. Mar 10, 2012
META.in check native dynlink support Aug 6, 2013
Makefile Version 1.3.2 Mar 1, 2016
README.md Markdowned readme Mar 12, 2012
bench.ml "-s" is now the default for ydump; "-u" must be used for the old Feb 7, 2012
common.ml remove trailing spaces and replace tabs with spaces Feb 21, 2016
common.mli remove trailing spaces and replace tabs with spaces Feb 21, 2016
opam Add local opam file for pinning Feb 21, 2016
pretty.ml remove trailing spaces and replace tabs with spaces Feb 21, 2016
pretty.mli "-s" is now the default for ydump; "-u" must be used for the old Feb 7, 2012
read.mli remove trailing spaces and replace tabs with spaces Feb 21, 2016
read.mll remove trailing spaces and replace tabs with spaces Feb 21, 2016
safe.ml "-s" is now the default for ydump; "-u" must be used for the old Feb 7, 2012
safe.mli remove trailing spaces and replace tabs with spaces Feb 21, 2016
sample.json Added benchmark program (comparison with json-wheel). May 6, 2010
test.json Fix #20 : invalid serialization Sep 4, 2015
type.ml "-s" is now the default for ydump; "-u" must be used for the old Feb 7, 2012
util.ml Add a Yojson.Safe.Util module Jan 22, 2016
util.mli Add deprecated ocamldoc tag Sep 24, 2015
write.ml remove trailing spaces and replace tabs with spaces Feb 21, 2016
write.mli remove trailing spaces and replace tabs with spaces Feb 21, 2016
write2.ml add convenience printer to `Format` (closes #24) Feb 21, 2016
write2.mli add convenience printer to `Format` (closes #24) Feb 21, 2016
ydump.ml Function and command-line option for sorting JSON object fields Mar 19, 2013
yojson.ml.cppo Add a Yojson.Safe.Util module Jan 22, 2016
yojson.mli.cppo Add a Yojson.Safe.Util module Jan 22, 2016
yojson_biniou.ml remove trailing spaces and replace tabs with spaces Feb 21, 2016
yojson_biniou.mli "-s" is now the default for ydump; "-u" must be used for the old Feb 7, 2012

README.md

Yojson: JSON library for OCaml

The main project page is http://mjambon.com/yojson.html Yojson supersedes json-wheel.

Design goals

  • reducing inter-package dependencies by the use of polymorphic variants for the JSON tree type

  • allowing variants of the JSON tree type to be shipped by the library itself or to be easily created as extensions of the library

  • allowing type-aware serializers/deserializers such as json-static to read and write directly without going through a JSON tree, for efficiency purposes. This requires making readers and writers of JSON atoms (int, string, etc.) to be exported and composable.

  • providing a few non-standard, optional extensions of JSON. These extensions will include:

    • optional quotes around "simple" field/constructor names
    • a syntax for tuples (at least 2 elements): (x, y)
    • a syntax for variants (0 or 1 arg only):

Other choices already in json-wheel

  • distinction between ints and floats (optional)

  • Getting rid of the UTF-X encoding constraint that prevents from exchanging binary data:

    • encoding is ASCII except for the contents of string literals
    • string literals may represent arbitrary sequence of bytes
    • \uABCD escapes in string literals expand to UTF-8

Miscellaneous

  • no dependency on ocamlnet for UTF-8