The following simple JSON Schema fails to compile, (in fact not a single schema I tried worked) but this reproduces the issue succinctly:
$ mix new json_test
* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating lib
* creating lib/json_test.ex
* creating test
* creating test/test_helper.exs
* creating test/json_test_test.exs
Your Mix project was created successfully.
You can use "mix" to compile it, test it, and more:
cd json_test
mix test
Run "mix help" for more commands.
$ cd json_test
mix.exs:
defmodule JsonTest.MixProject do
use Mix.Project
def project do
[
app: :json_test,
version: "0.1.0",
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:exonerate, "~> 1.1.2"}
]
end
end
$ mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.093s
New:
exonerate 1.1.2
jason 1.4.1
json_ptr 1.2.0
match_spec 0.3.1
* Getting exonerate (Hex package)
* Getting jason (Hex package)
* Getting json_ptr (Hex package)
* Getting match_spec (Hex package)
You have added/upgraded packages you could sponsor, run `mix hex.sponsor` to learn more
The following simple JSON Schema fails to compile, (in fact not a single schema I tried worked) but this reproduces the issue succinctly:
mix.exs:
lib/json_test.ex:
If I either remove the
id
OR if I refactor the schema as follows it does not error: