# `Attesto.StrictJSON`
[🔗](https://github.com/XukuLLC/attesto/blob/v2.28.0/lib/attesto/strict_json.ex#L1)

Strict JSON object decoder with duplicate-member rejection and nesting bounds.

RFC 8259 §4 states that object member names SHOULD be unique and notes that
implementations disagree when duplicate keys appear. Security-sensitive JSON
boundaries (JWS headers and claim sets, JWE protected headers, discovery and
metadata documents) must reject duplicate object members at parse time so an
input cannot mean one thing to a verifier and another to an intermediary.

# `decode`

```elixir
@spec decode(
  term(),
  keyword()
) :: {:ok, map()} | {:error, :invalid_json}
```

Decode a JSON binary into a map, rejecting duplicate object member names and
inputs that exceed `:max_json_depth` (default `32`).

Returns `{:ok, map}` when the top-level value is a JSON object with no
duplicate keys in any nested object, or `{:error, :invalid_json}` otherwise.

# `decode_value`

```elixir
@spec decode_value(
  term(),
  keyword()
) :: {:ok, term()} | {:error, :invalid_json}
```

Decode a JSON binary into any JSON value (object, array, or scalar),
rejecting duplicate object member names and inputs that exceed
`:max_json_depth` (default `32`) at any nesting level.

---

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