json_value

A JSON value representation that can be used to decode arbitrary JSON into json_value.JsonValue that can be manipulated and turned back into JSON again.

Types

pub type JsonValue {
  Null
  String(String)
  Int(Int)
  Bool(Bool)
  Float(Float)
  Array(List(JsonValue))
  Object(dict.Dict(String, JsonValue))
}

Constructors

Values

pub fn decoder() -> decode.Decoder(JsonValue)

Decodes a value into an json_value.Json.

pub fn parse(json: String) -> Result(JsonValue, json.DecodeError)

Parse a String to a json_value.Json

pub fn parse_bits(
  json: BitArray,
) -> Result(JsonValue, json.DecodeError)

Parse a BitArray to a json_value.Json

pub fn to_json(value: JsonValue) -> json.Json

Convert a json_value.Json value to a json_value.Json value.

pub fn to_string(value: JsonValue) -> String

Convert a json_value.Json to a JSON string.

pub fn to_string_tree(value: JsonValue) -> string_tree.StringTree

Convert a json_value.Json to a string_tree.StringTree

Search Document