I am receiving errors even the the required
is set as false
. Below are the params & the rules. Anybody who has worked with this. What am I doing wrong?
Params:
%{"tags" => ["tag1", "tag2"]}
Rules:
%{
"referral_url_query" => [required: false, type: :string],
"referred_by" => [required: false, type: :uuid],
"status" => [
required: false,
type: :string,
in: ["approved", "banned", "pending"]
],
"tags" => [
required: false,
type: :list,
list: [required: false, type: :string]
]
}
Errors:
[
referral_url_query: {"expected string received nil", [rule: :type]},
status: {"expected string received nil", [rule: :type]}
]