Skip to content
JSON parsing and pretty-printing library for OCaml
OCaml Makefile Standard ML
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
.gitignore
.merlin
Changes
INSTALL
LICENSE
META.in
Makefile
README.md
bench.ml
common.ml
common.mli
opam
pretty.ml
pretty.mli
read.mli
read.mll
safe.ml
safe.mli
sample.json
test.json
type.ml
util.ml
util.mli
write.ml
write.mli
write2.ml
write2.mli
ydump.ml
yojson.ml.cppo
yojson.mli.cppo
yojson_biniou.ml
yojson_biniou.mli

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
Something went wrong with that request. Please try again.