diff --git a/lib/nimble_options.ex b/lib/nimble_options.ex index 4c00ad3..1653f0f 100644 --- a/lib/nimble_options.ex +++ b/lib/nimble_options.ex @@ -898,7 +898,7 @@ defmodule NimbleOptions do keys schema_opts -> - Enum.map(opts, fn {k, _} -> {k, schema_opts} end) + keys ++ Enum.map(opts, fn {k, _} -> {k, schema_opts} end) end end diff --git a/test/nimble_options_test.exs b/test/nimble_options_test.exs index 72c487e..39d319b 100644 --- a/test/nimble_options_test.exs +++ b/test/nimble_options_test.exs @@ -93,6 +93,11 @@ defmodule NimbleOptionsTest do assert NimbleOptions.validate([context: :given], schema) == {:ok, [context: :given]} end + test "is used when wildcard-key is defined" do + schema = [context: [default: :ok], *: [type: :any]] + assert NimbleOptions.validate([], schema) == {:ok, [context: :ok]} + end + test "is validated" do schema = [ processors: [