Closed c4710n closed 5 months ago
When trying the example code in README.md:
README.md
definition = [ connections: [ type: :non_neg_integer, default: 5 ], url: [ type: :string, required: true ] ] options = [] NimbleOptions.validate(options, definition)
It returns:
{:error, %NimbleOptions.ValidationError{ message: "required :url option not found, received options: [:connections]", key: :url, value: nil, keys_path: [] }}
We provide options as [],
options
[]
But, the message: line shows that the received options are [:connections].
message:
[:connections]
It seems that the received options considers the default values, but should we consider the default values when showing the received options?
Yes, looks like a bug to me! PRs welcome!
When trying the example code in
README.md
:It returns:
We provide
options
as[]
,But, the
message:
line shows that the received options are[:connections]
.It seems that the received options considers the default values, but should we consider the default values when showing the received options?