package octez-proto-libs

  1. Overview
  2. Docs
Octez protocol libraries

Install

Dune Dependency

Authors

Maintainers

Sources

octez-19.1.tar.gz
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053

doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V3/Make/Data_encoding/Json/index.html

Module Data_encoding.Json

val schema : ?definitions_path:string -> 'a encoding -> json_schema
val construct : 't encoding -> 't -> json
val destruct : 't encoding -> json -> 't

JSON Error

type path = path_item list
and path_item = [
  1. | `Field of string
    (*

    A field in an object.

    *)
  2. | `Index of int
    (*

    An index in an array.

    *)
  3. | `Star
    (*

    Any / every field or index.

    *)
  4. | `Next
    (*

    The next element after an array.

    *)
]
exception Cannot_destruct of path * exn

Exception raised by destructors, with the location in the original JSON structure and the specific error.

exception Unexpected of string * string

Unexpected kind of data encountered (w/ the expectation).

exception No_case_matched of exn list

Some union couldn't be destructed, w/ the reasons for each case.

exception Bad_array_size of int * int

Array of unexpected size encountered (w/ the expectation).

exception Missing_field of string

Missing field in an object.

exception Unexpected_field of string

Supernumerary field in an object.

val print_error : ?print_unknown:(Format.formatter -> exn -> unit) -> Format.formatter -> exn -> unit
val cannot_destruct : ('a, Format.formatter, unit, 'b) Pervasives.format4 -> 'a

Helpers for writing encoders.

val wrap_error : ('a -> 'b) -> 'a -> 'b
val pp : Format.formatter -> json -> unit
OCaml

Innovation. Community. Security.