I have the following:
NameStruct {
first: nonempty(size( pattern( string(), nounRegex()as RegExp), 2, 20)),
}
When the first property is empty (''), it is the pattern error that is generated
{key: 'first', message: 'At path: first -- Expected a string matching `/^[A-Za-z\' -]+$/` but received ""', refinement: 'pattern', value: ''}
key
:
"first"
message
:
"At path: first -- Expected a string matching `/^[A-Za-z' -]+$/` but received \"\""
refinement
:
"pattern"
value
:
""
How can I get the error message to show the 'nonempty' refinement
NB. I am actually attempting to make a text input required.