package geojson

  1. Overview
  2. Docs

Module type Geojson.JsonSource

Types for the JSON parser

Sourcetype t

The type your parser uses to represent a parsed JSON object.

Sourceval find : t -> string list -> t option

Recursively find keys in nested objects.

Sourceval to_string : t -> (string, [ `Msg of string ]) result

Convert the JSON to a string.

Sourceval string : string -> t

Create a JSON string.

Sourceval to_float : t -> (float, [ `Msg of string ]) result

Convert the JSON to a float.

Sourceval float : float -> t

Converts a float to JSON

Sourceval to_int : t -> (int, [ `Msg of string ]) result

Convert the JSON to an integer.

Sourceval int : int -> t

Converts an integer to JSON

Sourceval to_list : (t -> 'a) -> t -> ('a list, [ `Msg of string ]) result

to_list f converts the JSON array to a list and applies f to each element to convert them too.

Sourceval list : ('a -> t) -> 'a list -> t

Make a JSON array from a list

Sourceval to_array : (t -> 'a) -> t -> ('a array, [ `Msg of string ]) result

Like to_list except to an array.

Sourceval array : ('a -> t) -> 'a array -> t

Like list except for OCaml arrays

Sourceval to_obj : t -> ((string * t) list, [ `Msg of string ]) result

Convert the JSON object to an association list

Sourceval obj : (string * t) list -> t

A JSON object from an association list

Sourceval null : t

Null value

Sourceval is_null : t -> bool

Test for null

OCaml

Innovation. Community. Security.