json

Ensures the value of field under validation is safe to be parsed using JSON.parse method.

const rules = {
  payload: 'json'
}

// or
const rules = {
  payload: [
    rule('json')
  ]
}

For customized build, you can import this rule as follows.

import { json } from 'indicative/builds/validations'