Socket
Book a DemoInstallSign in
Socket

json-schema-validation-strategy

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-validation-strategy

Json schema validator for react-validation-mixin

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

json-schema-validation-strategy

Build Status npm version

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);

Keywords

json-schema

FAQs

Package last updated on 11 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts