Core Library0.xAPI reference

Choose documentation 1

pr-173

Current version

pr-173
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

module libtmux-elixir

Wire

Bounded JSON decoding with duplicate keys preserved until validation.

Source and package
Qualified name
LibTmux.Wire
Module
LibTmux
Package
libtmux
Source
lib/libtmux/wire.ex
LibTmux.Wire

Description

Uses the built-in JSON decoder callbacks. Object keys stay strings; no atoms are created. Byte, nesting, node, array and string ceilings apply before conversion to public maps. Parsing failures retain root paths and offsets where supplied; duplicate-key failures identify the object path. Depth starts at zero for the root value and increases for every object member or array element; the maximum is inclusive for maps and JSON alike.

Members4 members

  • decode/2 function Decodes one complete bounded JSON value, rejecting duplicate keys and trailing data.
  • object/0: object() :: %{optional(String.t()) => value()} typealias A JSON object whose keys remain strings; validation never creates atoms from external names.
  • validate/2 function Validates already-decoded JSON data and its complete encoded byte size.
  • value/0: value() :: nil | boolean() | integer() | float() | String.t() | [value()] | object() typealias A JSON value with string-keyed objects; invalid external terms return a validation error.
Esc
Search in

Type to search.

Reference previewOpen reference