Module Jsonxt.Yojson

Yojson compatibility module

To use Jsonxt's Yojson compatibility module create a yojson.ml file in the projects source directory with the following contents:

include Jsonxt.Yojson

Note that compatibility is mostly a thin layer on top of Jsonxt. In particular the error reporting by the utils module uses the Failure exception rather than Yojson's specialist exceptions

JSON compatibility differences

The underlying parser used by the Yojson compatibility modules are RFC 8259 compliant except for specific extensions. In particular:

Behavioural differences

exception Json_error of string
type lexer_state = {
buf : Stdlib.Buffer.t;
mutable lnum : int;
mutable bol : int;
mutable fname : string option;
}
val init_lexer : ?⁠buf:Stdlib.Buffer.t -> ?⁠fname:string -> ?⁠lnum:int -> unit -> lexer_state
module Basic : sig ... end
module Safe : sig ... end
module Raw : sig ... end