Sha256: 24b61530e39958af5226a30c772b69592899c8667b59c836141ea307389f5075

Contents?: true

Size: 430 Bytes

Versions: 44

Compression:

Stored size: 430 Bytes

Contents

var validator = require('./')

var validate = validator({
  type: 'object',
  properties: {
    hello: {
      required: true,
      type: 'string'
    }
  }
})

console.log('should be valid', validate({hello: 'world'}))
console.log('should not be valid', validate({}))

// get the last error message by checking validate.error
// the following will print "data.hello is required"
console.log('the errors were:', validate.errors)

Version data entries

44 entries across 39 versions & 12 rubygems

Version Path
optimacms-0.4.3 spec/dummy/node_modules/is-my-json-valid/example.js
optimacms-0.4.2 spec/dummy/node_modules/is-my-json-valid/example.js
locomotivecms-3.4.0 app/javascript/node_modules/is-my-json-valid/example.js
guard-sass-lint-0.1.2 node_modules/is-my-json-valid/example.js
guard-sass-lint-0.1.1 node_modules/is-my-json-valid/example.js
lanes-0.8.0 node_modules/fsevents/node_modules/is-my-json-valid/example.js
lanes-0.8.0 node_modules/is-my-json-valid/example.js
node-compiler-0.9.1 vendor/node/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
select_all-rails-0.3.1 node_modules/is-my-json-valid/example.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
tck-lambdas-0.3.10 lib/tck/lambdas/chistacojs/source/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
tck-lambdas-0.3.9 lib/tck/lambdas/chistacojs/source/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
tck-lambdas-0.3.8 lib/tck/lambdas/chistacojs/source/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
tck-lambdas-0.3.7 lib/tck/lambdas/chistacojs/source/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
tck-lambdas-0.3.6 lib/tck/lambdas/chistacojs/source/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
tck-lambdas-0.3.5 lib/tck/lambdas/chistacojs/source/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
tck-lambdas-0.3.4 lib/tck/lambdas/chistacojs/source/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js