- Fix docs.
- Update deps.
- Adding option
:fail
toXema.validate/3
.
- Update xema.
- The error data structure for
array
items
has changed from alist
oftuple
s to amap
. This change allows you to convertreason
directly to JSON.
since: 0.5.0
iex> schema = ~s({"type" : "array", "items" : {"type" : "string" }})
...> |> Jason.decode!()
...> |> JsonXema.new()
iex> validate(schema, [1, 2, "foo"])
%ValidationError{
reason: %{
items: %{2 => %{type: "integer", value: "foo"}}
}
}
before: 0.5.0
iex> schema = ~s({"type" : "array", "items" : {"type" : "string" }})
...> |> Jason.decode!()
...> |> JsonXema.new()
iex> validate(schema, [1, 2, "foo"])
%ValidationError{
reason: %{
items: [{2, %{type: "integer", value: "foo"}}]
}
}
- Update deps.
- Minor changes.
- Fix conversion of letter case for enum.
- Update
xema
to 0.11.
- Update deps.
- Update specs.
- Bugfix for #19
- update
xema
to 0.9.1 - Change error tuple returned by
JsonXema.validate/2
. The function returns{:error, JsonXema.ValidationError}
instead of{:error, map}
.ValidationError.reason
contains nearly the same value asmap
before. - Error messages are improved.
iex> schema = JsonXema.new(%{"type" => "string"}) iex> {:error, error} = JsonXema.validate(schema, 6) iex> Exception.message(error) ~s|Expected "string", got 6.|
- Update
xema
to 0.8.0