# `Exdantic.Settings`
[🔗](https://github.com/nshkrdotcom/exdantic/blob/v0.1.0/lib/exdantic/settings.ex#L1)

Env-based settings loader for Exdantic schemas.

This module builds schema input from environment variables and explicit input,
then delegates validation to the existing Exdantic validation pipeline.

v1 behavior:
- Field names derive env keys as `snake_case -> UPPER_SNAKE`, joined by
  `env_nested_delimiter` (default `"__"`), with `env_prefix` prepended.
- Field override `extra: %{"env" => "KEY"}` is absolute; prefix is not applied.
  If both override and derived key exist, override wins.
- Structured values (`array`, maps/objects, nested schema refs) are JSON-only.
- Union decoding is conservative: JSON is attempted only for JSON-like strings
  (`{` or `[`) when the union includes structured members; otherwise raw strings
  are passed to validation.
- Exploded nested env keys do not address arrays in v1 (`APP_ITEMS__0` is ignored).

# `load_option`

```elixir
@type load_option() ::
  {:input, map()}
  | {:env, map()}
  | {:env_prefix, String.t()}
  | {:env_nested_delimiter, String.t()}
  | {:case_sensitive, boolean()}
  | {:ignore_empty, boolean()}
  | {:allow_atoms, false | :existing}
  | {:bool_numeric, boolean()}
```

# `from_system_env`

```elixir
@spec from_system_env(module(), [load_option()]) ::
  {:ok, map() | struct()} | {:error, [Exdantic.Error.t()]}
```

# `load`

```elixir
@spec load(module(), [load_option()]) ::
  {:ok, map() | struct()} | {:error, [Exdantic.Error.t()]}
```

# `load!`

```elixir
@spec load!(module(), [load_option()]) :: map() | struct()
```

---

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