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")
Summary
Functions
Imports the ~X sigil for compile-time schema literals.
Compile-time sigil for Elixir schema literals.