From 54c7109dfbf7da3b8fa99a1ef19ed93126ce4a58 Mon Sep 17 00:00:00 2001 From: sitch <2736163+sitch@users.noreply.github.com> Date: Wed, 9 Dec 2020 19:38:25 -0500 Subject: [PATCH] Add typespecs --- lib/absinthe_error_payload/validation_message.ex | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/absinthe_error_payload/validation_message.ex b/lib/absinthe_error_payload/validation_message.ex index c5f62d2..51b3b28 100644 --- a/lib/absinthe_error_payload/validation_message.ex +++ b/lib/absinthe_error_payload/validation_message.ex @@ -38,6 +38,21 @@ defmodule AbsintheErrorPayload.ValidationMessage do ### :key Deprecated, use :field instead """ + + @type t() :: %__MODULE__{ + field: atom() | String.t() | nil, + key: atom() | String.t() | nil, + code: atom() | String.t(), + options: [option()], + template: String.t(), + message: String.t() + } + + @type option() :: %{ + required(:key) => any(), + required(:value) => any() + } + @enforce_keys [:code] defstruct field: nil, key: nil, code: nil, options: [], template: "is invalid", message: "is invalid" end