# `JSONSchex.Sigil`
[🔗](https://github.com/xinz/jsonschex/blob/main/lib/jsonschex/sigil.ex#L1)

Compile-time sigils for static JSON Schema literals.

The primary sigil is `~X`, chosen to avoid the common `~J` conflict with
Jason while still feeling mnemonic for JSONSchex.

The sigil body is parsed as Elixir, not JSON, so the most ergonomic form is
an Elixir map or boolean literal.

## Examples

    iex> import JSONSchex.Sigil, only: [sigil_X: 2]
    iex> schema = ~X|%{"type" => "integer"}|
    iex> JSONSchex.validate(schema, 1)
    :ok

    iex> import JSONSchex.Sigil, only: [sigil_X: 2]
    iex> schema = ~X|%{"type" => "string", "format" => "email"}|f
    iex> {:error, [_]} = JSONSchex.validate(schema, "not-an-email")

# `__using__`
*macro* 

Imports the `~X` sigil for compile-time schema literals.

# `sigil_X`
*macro* 

Compile-time sigil for Elixir schema literals.

Supported modifiers:

- `f` — `format_assertion: true`
- `c` — `content_assertion: true`

---

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