# `Kombu.Utils.JSON`
[🔗](https://github.com/hacktobeer/kombu/blob/v0.1.0/lib/kombu/utils/json.ex#L1)

Extended JSON serialization utilities matching `kombu.utils.json`.

Supports Kombu's `{"__type__": marker, "__value__": encoded}` envelope for
`datetime`, `date`, `time`, `decimal`, `uuid`, `bytes`, `base64`, and
user-registered struct types.

# `dumps`

```elixir
@spec dumps(term(), keyword()) :: String.t()
```

Serialize an Elixir term to a JSON string using Kombu's extended type tags.

# `dumps!`

```elixir
@spec dumps!(term(), keyword()) :: String.t()
```

# `loads`

```elixir
@spec loads(binary() | list(), keyword()) :: term()
```

Deserialize a JSON string or binary into an Elixir term, applying `object_hook`
to decode `{"__type__": ..., "__value__": ...}` envelopes.

# `loads!`

```elixir
@spec loads!(binary() | list(), keyword()) :: term()
```

# `object_hook`

```elixir
@spec object_hook(map()) :: term()
```

Default object hook that decodes `{"__type__": marker, "__value__": val}` maps.

# `register_default_types`

Reset and register the default Kombu extended JSON types.

# `register_type`

```elixir
@spec register_type(module(), String.t() | nil, (term() -&gt; term()), (term() -&gt; term())) ::
  :ok
```

Register a custom Elixir struct module for JSON serialization/deserialization.

If `marker` is `nil`, the encoder output is not wrapped in `{"__type__": ..., "__value__": ...}`.

---

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