Skip to content

Commit b2d36ba

Browse files
authored
Widen ValidationError :key type to allow lists (#151)
1 parent f16af25 commit b2d36ba

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/nimble_options/validation_error.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule NimbleOptions.ValidationError do
99
"""
1010

1111
@type t() :: %__MODULE__{
12-
key: atom(),
12+
key: atom() | [atom()],
1313
keys_path: [atom()],
1414
redact: boolean,
1515
value: term()
@@ -21,7 +21,9 @@ defmodule NimbleOptions.ValidationError do
2121
Only the following documented fields are considered public. All other fields are
2222
considered private and should not be referenced:
2323
24-
* `:key` (`t:atom/0`) - The key that did not successfully validate.
24+
* `:key` (`t:atom/0` or list of `t:atom/0`) - The key that did not successfully
25+
validate. When several keys are involved in the same error (for example,
26+
unknown options reported as a group), this is the list of those keys.
2527
2628
* `:keys_path` (list of `t:atom/0`) - If the key is nested, this is the path to the key.
2729

0 commit comments

Comments
 (0)