# `A2A.Version`
[🔗](https://github.com/actioncard/a2a-elixir/blob/main/lib/a2a/version.ex#L1)

Helpers for the `A2A-Version` HTTP header (A2A v1.0 spec §3.6).

Versions are negotiated as `Major.Minor` strings. Patch components are
not significant and are stripped during normalization. Per spec §3.6.2
an empty or missing version is interpreted as `"0.3"`.

# `default`

```elixir
@spec default() :: String.t()
```

Default version a client sends in the `A2A-Version` request header.

# `normalize`

```elixir
@spec normalize(String.t() | nil) :: String.t()
```

Normalizes a version string to its `Major.Minor` form.

- `nil` and `""` → `"0.3"` (per spec §3.6.2)
- `"1.0.3"` → `"1.0"`
- `"  0.3  "` → `"0.3"`

Values that can't be parsed as `Major.Minor` are returned trimmed so the
caller can include them in an error response.

# `parse_header`

```elixir
@spec parse_header([String.t()] | String.t() | nil) :: String.t()
```

Parses a Plug-style header value (list of strings, single string, or nil)
into a normalized `Major.Minor` version. An empty list or missing value
becomes `"0.3"`.

# `supported_default`

```elixir
@spec supported_default() :: [String.t()]
```

Default list of versions a server accepts.

# `validate`

```elixir
@spec validate(String.t(), [String.t()]) :: :ok | {:error, String.t()}
```

Returns `:ok` when `version` is in the supported list, otherwise
`{:error, version}` with the rejected value so the caller can surface it
in a `VersionNotSupportedError`.

---

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