Given the schema
below, how would I access the minLength
property to dynamically show the user how many characters are required?
export const schema = {
type: 'object',
properties: {
inputControl: {
type: 'string',
format: 'email',
minLength: 10,
errorMessage: {
minLength: 'String must contain at least ${/properties/minLength} character(s)',
format: 'Please enter valid email',
}
},
},
}
I have tried ${/properties/minLength}
and numerous other options, but everything returns undefined
or throws an error. The best I got was ${0#}
, which returns inputControl
.
New contributor
Kiran Anand is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.