vex icon indicating copy to clipboard operation
vex copied to clipboard

Deep attribute matching (querying/addressability)

Open bruce opened this issue 11 years ago • 2 comments

It would be useful to have "attributes" be anything that we can find with Kernel.get_in:

Vex.valid? article, %{ [:author, :name] => [presence: true] }

bruce avatar Sep 17 '14 03:09 bruce

Is this fixed by #4?

jtmoulia avatar Mar 18 '15 22:03 jtmoulia

@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.

Qqwy avatar Aug 16 '18 09:08 Qqwy