# `LibTmux.Wire`
[🔗](https://github.com/libtmux/libtmux-elixir/blob/b72452c198917433229bdc266a68c163541b6127/lib/libtmux/wire.ex#L1)

Bounded JSON decoding with duplicate keys preserved until validation.

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.

# `object`

```elixir
@type object() :: %{optional(String.t()) =&gt; value()}
```

A JSON object whose keys remain strings; validation never creates atoms from external names.

# `value`

```elixir
@type value() ::
  nil | boolean() | integer() | float() | String.t() | [value()] | object()
```

A JSON value with string-keyed objects; invalid external terms return a validation error.

# `decode`

```elixir
@spec decode(binary(), [LibTmux.Filter.limit_option()]) ::
  {:ok, value()} | {:error, LibTmux.Error.t()}
```

Decodes one complete bounded JSON value, rejecting duplicate keys and trailing data.

# `validate`

```elixir
@spec validate(term(), [LibTmux.Filter.limit_option()]) ::
  {:ok, value()} | {:error, LibTmux.Error.t()}
```

Validates already-decoded JSON data and its complete encoded byte size.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
