-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Would be nice to have an option to fail the validation when extra keys/data present than in the rules. It will be useful in the test case assertions to ensure API does not return any unwanted/protected data. Same for incoming requests also, it would be nice to inform the client when unsupported keys are given than ignoring them.
Without option
{ok, data} = Validate.validate(%{name: "joe", age: 30}, %{name: [type: string]})
data == %{name: "joe"}With option, something like
{:error, _} = Validate.validate(%{name: "joe", age: 30}, %{name: [type: string]}, %{unknown: :reject})
# age not allowedYour thoughts ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels