JSON Schema validation strategy for react-validation-mixin.
This library provides a validation strategy based on the library jsen
validatorTypes: {
type: 'object',
required: ['username'],
properties: {
username: {
type: 'string',
label: 'Field name'
}
}
}
validatorTypes: {
type: 'object',
required: ['username'],
properties: {
username: {
type: 'string',
minLength: 5,
invalidMessage: 'Invalid username',
requiredMessage: 'Username is required'
}
}
}
const options = {
messages: {
required: '{{key}} custom required message.'
}
}
export default validation(strategy(options))(component);