From c1e5352d8e402e7d78ff7f77be1060482c41bebb Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Fri, 20 Oct 2023 11:19:09 +0200 Subject: [PATCH] Update README.md --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 02c818a..5d5b1f7 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,18 @@ UserContract.conform(%{name: "Jane", email: "jane@doe.org"}) UserContract.conform(%{email: 312}) # {:error, [error: {[], :has_key?, [:name]}]} -UserContract.conform(%{name: "Jane", email: 312}) -# {:error, [error: {[:email], :type?, [:string, 321]}]} +{:error, errors} = UserContract.conform(%{name: "Jane", email: 312}) +# {:error, +# [ +# %Drops.Contract.Messages.Error.Type{ +# path: [:email], +# text: "must be a string", +# meta: %{args: [:string, 312], predicate: :type?} +# } +# ]} + +Enum.map(errors, &to_string/1) +# ["email must be a string"] ``` ## Schemas