Atdgen uses type definitions in the ATD syntax and generates efficient JSON serializers, deserializers and validators for OCaml.
$ opam install atdgen
https://mjambon.github.io/atdgen-doc/
See https://github.com/mjambon/documents/blob/master/how-to-contribute.md