# `Bourse.JsonDocument`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/json_document.ex#L1)

Strict JSON document decoding shared by compile-time loaders.

Rejects duplicate object keys at any nesting level before decoding with
Jason, so hand-edited documents fail loudly instead of silently keeping
the first key occurrence.

# `decode_file!`

```elixir
@spec decode_file!(String.t()) :: map() | list()
```

Decodes a JSON document after rejecting duplicate object keys.

Raises `ArgumentError` naming the file, duplicated key, and object path on
duplicates. Malformed JSON still raises `Jason.DecodeError` with a byte
position rather than an opaque `:json` ErlangError.

---

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