vex
vex copied to clipboard
Deep attribute matching (querying/addressability)
It would be useful to have "attributes" be anything that we can find with Kernel.get_in:
Vex.valid? article, %{ [:author, :name] => [presence: true] }
Is this fixed by #4?
@jtmoulia It does not seem to be the case:
iex> Vex.errors(%{foo: %{bar: 10}}, %{[:foo, :bar] => [presence: true]})
[{:error, [:foo, :bar], :presence, "must be present"}]
Vex.errors(%{[:foo, :bar] => 10}, %{[:foo, :bar] => [presence: true]})
[]
So [:foo, :bar] is still taken as a whole as key.