json-schema-validation-strategy
v1.1.2
Published
Json schema validator for react-validation-mixin
Downloads
7
Maintainers
Readme
json-schema-validation-strategy
JSON Schema validation strategy for react-validation-mixin.
This library provides a validation strategy based on the library jsen
Custom messages and i18n
Property name override
validatorTypes: {
type: 'object',
required: ['username'],
properties: {
username: {
type: 'string',
label: 'Field name'
}
}
}
Message override
validatorTypes: {
type: 'object',
required: ['username'],
properties: {
username: {
type: 'string',
minLength: 5,
invalidMessage: 'Invalid username',
requiredMessage: 'Username is required'
}
}
}
Global message override
const options = {
messages: {
required: '{{key}} custom required message.'
}
}
export default validation(strategy(options))(component);