# `Sinter.JSON`
[🔗](https://github.com/nshkrdotcom/sinter/blob/v0.3.1/lib/sinter/json.ex#L1)

JSON encode/decode helpers with Sinter validation and transforms.

# `decode_opts`

```elixir
@type decode_opts() :: Sinter.Validator.validation_opts()
```

# `encode_opts`

```elixir
@type encode_opts() :: [aliases: map(), formats: map(), drop_nil?: boolean()]
```

# `decode`

```elixir
@spec decode(String.t(), Sinter.Schema.t(), decode_opts()) ::
  {:ok, map()} | {:error, [Sinter.Error.t()]}
```

Decodes JSON and validates against a schema.

# `decode!`

```elixir
@spec decode!(String.t(), Sinter.Schema.t(), decode_opts()) :: map()
```

Decodes JSON and validates against a schema, raising on failure.

# `encode`

```elixir
@spec encode(term(), encode_opts()) :: {:ok, String.t()} | {:error, term()}
```

Encodes data as JSON after applying the transform pipeline.

# `encode!`

```elixir
@spec encode!(term(), encode_opts()) :: String.t()
```

Encodes data as JSON and raises on failure.

---

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