package aws

  1. Overview
  2. Docs

This module contains a Json type (compatible with Yojson.Basic.json) and helpers.

type t = [
  1. | `Assoc of (string * t) list
  2. | `Bool of bool
  3. | `Float of float
  4. | `Int of int
  5. | `List of t list
  6. | `Null
  7. | `String of string
]

Json type. This is compatible with Yojson.Basic.json

exception Casting_error of string * t

This is thrown in the case that an unsafe cast (like to_list below) fails.

val to_list : (t -> 't) -> t -> 't list

This converts a `List (t list) to 't list, or throws a Casting_error in the case that the input is not a `List.

val lookup : t -> string -> t option

If t is an `Assoc, this looks up the field specified. If it isn't found, or if the input is not an `Assoc, returns None.

OCaml

Innovation. Community. Security.