default
Sets the value if it is empty: missing, null or an empty string. Other values, including 0, are kept.
rules
input
Validoutput
{
"age": 18,
"country": "PL"
}Sets the value if it is empty: missing, null or an empty string. Other values, including 0, are kept.
{
age: { default: 18 },
country: { default: 'UA' }
}{
country: 'PL'
}{
"age": 18,
"country": "PL"
}