# `JSONSchex.Draft202012.Schemas`
[🔗](https://github.com/xinz/jsonschex/blob/main/lib/jsonschex/draft202012/schemas.ex#L1)

Provides built-in JSON Schema resources bundled directly in the module.

This module embeds the canonical Draft 2020-12 meta-schema family as Elixir
maps, avoiding runtime file reads and JSON decoding. It also exposes a
compiled defs registry so built-in `$ref` and `$dynamicRef` targets can
participate in normal runtime resolution.

The public API is intentionally small:

- `fetch/1` returns `{:ok, schema_map}` or `:error`
- `known_uri?/1` reports whether a URI is bundled
- `compiled_defs/1` returns a compiled defs registry for the built-in family

# `compiled_defs`

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

Returns the compiled defs registry for the built-in schema family containing
the given URI.

The returned map includes:
- each built-in resource under its canonical absolute URI
- all compiled defs discovered within each resource
- all `$anchor` and `$dynamicAnchor` absolute entries discovered by scanning
  the raw built-in resources

This allows built-in schemas to behave like a normal compiled defs registry
during `$ref` and `$dynamicRef` resolution.

# `fetch`

```elixir
@spec fetch(String.t()) :: {:ok, map()} | :error
```

Fetches a bundled schema by canonical URI.

Returns `{:ok, map}` when the URI is known, otherwise returns `:error`.

## Examples

    iex> {:ok, schema} = JSONSchex.Draft202012.Schemas.fetch("https://json-schema.org/draft/2020-12/schema")
    iex> is_map(schema)
    true

    iex> JSONSchex.Draft202012.Schemas.fetch("https://example.com/custom")
    :error

# `known_uri?`

```elixir
@spec known_uri?(String.t()) :: boolean()
```

Returns `true` if the given URI is bundled with the library.

## Examples

    iex> JSONSchex.Draft202012.Schemas.known_uri?("https://json-schema.org/draft/2020-12/schema")
    true

    iex> JSONSchex.Draft202012.Schemas.known_uri?("https://example.com/custom")
    false

---

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