# `BoundedAuthorityProtocol.V1.Json`
[🔗](https://github.com/baselabs/bounded_authority_protocol/blob/v1.0.0/lib/bounded_authority_protocol/v1/json.ex#L1)

Bounded JSON decoder preserving object order and rejecting duplicate binary names.

`decode/2` returns the tagged, closed v1 algebra documented by `t:value/0`; it never atomizes an
input name. Raw numeric lexemes are byte-bounded and exact-magnitude-checked before OTP
conversion. Caller limits may only tighten the positive-integer hard maxima. Every failure is
the fixed value-free `{:error, :invalid}`.

Draft 2020-12 schemas shipped with the package describe structural shape. They do not replace
this decoder's duplicate-name, raw-lexeme, UTF-8 byte, depth, node, or exact encoding checks.

# `value`

```elixir
@type value() ::
  :null
  | {:boolean, boolean()}
  | {:integer, integer()}
  | {:float, float()}
  | {:string, binary()}
  | {:array, [value()]}
  | {:object, [{binary(), value()}]}
```

Closed v1 JSON value algebra.

# `decode`

```elixir
@spec decode(binary(), BoundedAuthorityProtocol.V1.Bounds.t() | map()) ::
  {:ok, value()} | {:error, :invalid}
```

Decodes one complete bounded JSON value.

---

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