Closed solnic closed 1 year ago
This adds support for typed lists
defmodule TestContract do use Drops.Contract schema do %{ required(:tags) => type(list: %{ required(:name) => type(:string) }) } end end TestContract.conform(%{tags: [%{name: "red"}, %{name: "green"}, %{name: "blue"}]}) # {:ok, %{tags: [%{name: "red"}, %{name: "green"}, %{name: "blue"}]}} TestContract.conform(%{tags: [%{name: "red"}, %{name: 312}, %{name: "blue"}]}) # {:error, [error: [{:string?, [:tags, 1, :name], 312}]]}
Closes #13
This adds support for typed lists
Closes #13