{"_id":"express-jsonschema","_rev":"32-d56a45d36fd496d7fd3db1f9592bc8d0","name":"express-jsonschema","description":"Express middleware for jsonschema validation.","dist-tags":{"latest":"1.1.6"},"versions":{"0.0.0":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"0.0.0","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/metalculus84/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0","object-assign":"^2.0.0"},"devDependencies":{"istanbul":"^0.3.5","mocha":"^2.1.0","should":"^4.6.1","sinon":"^1.12.2"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"8caab9afc27c0dadc0b86e5023064a4618af7ce9","bugs":{"url":"https://github.com/metalculus84/express-jsonschema/issues"},"homepage":"https://github.com/metalculus84/express-jsonschema","_id":"express-jsonschema@0.0.0","_shasum":"4d292dd2067d3f5382bf822298ee21e5e23c47e2","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"4d292dd2067d3f5382bf822298ee21e5e23c47e2","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-0.0.0.tgz","integrity":"sha512-VthXsW5p2agrUbnaslblyE7EYX4EdtNnE3ZGBnLKFjWurZvtDEfUOvdr4nzX0xzalwpdOzBQ+CgJlkChysZBCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLEttn0jfzC+D1v/Iq84PcspI1SMxkiSf3M5zDMLm1kwIga4GMpqsBoG93Q/VitJe9kIqn8YFChecl/n94r0ZSIlE="}]},"directories":{}},"0.0.1":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"0.0.1","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/metalculus84/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0","object-assign":"^2.0.0"},"devDependencies":{"istanbul":"^0.3.5","mocha":"^2.1.0","should":"^4.6.1","sinon":"^1.12.2"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"8caab9afc27c0dadc0b86e5023064a4618af7ce9","bugs":{"url":"https://github.com/metalculus84/express-jsonschema/issues"},"homepage":"https://github.com/metalculus84/express-jsonschema","_id":"express-jsonschema@0.0.1","_shasum":"f79b3deb72391955e16483b405d4f3abac2b93b7","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"f79b3deb72391955e16483b405d4f3abac2b93b7","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-0.0.1.tgz","integrity":"sha512-lnxkvpTVmnHNttMsriY8v4jdWcUkiE4yZviBgYB3paD5kDs7IEL8JnYv8z4XR6ocllhXdVnDSz0WNcdGman5hQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFAkIyq9HwsYCEeN+1ZbPtwOD9eOEqH7phbJzbI6LqFwIhAO9Za9jz1Fu8ghost/3sN6/ZwEYKHWJeGyutM/7AMIul"}]},"directories":{}},"0.0.2":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"0.0.2","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/metalculus84/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0","object-assign":"^2.0.0"},"devDependencies":{"istanbul":"^0.3.5","mocha":"^2.1.0","should":"^4.6.1","sinon":"^1.12.2"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"60c247684efb5c59ae0b093c1c05f029d8a74e7d","bugs":{"url":"https://github.com/metalculus84/express-jsonschema/issues"},"homepage":"https://github.com/metalculus84/express-jsonschema","_id":"express-jsonschema@0.0.2","_shasum":"7265abf82565480d4513b1baba01dfc1a9218940","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"7265abf82565480d4513b1baba01dfc1a9218940","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-0.0.2.tgz","integrity":"sha512-Ve3ivxExaSP7q0ttEozM+9dYR+BdR6DXOtQO6J2J+qKsz+WLBj2rbMFtzZHeEa4oiiTdk6AvNVq2a242kvZBiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCl3ziK/II3Ns+6CWENatgbGgqw6l6yvscbEVSEx7NbnAIhANDC35k5HL1ETAP7hTt+F5BRD5QAAHMI/ReLFlTtsEmH"}]},"directories":{}},"0.0.3":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"0.0.3","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/metalculus84/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0","object-assign":"^2.0.0"},"devDependencies":{"istanbul":"^0.3.5","mocha":"^2.1.0","should":"^4.6.1","sinon":"^1.12.2"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"9e355b71cc604faada5f800136fd36dbd88da839","bugs":{"url":"https://github.com/metalculus84/express-jsonschema/issues"},"homepage":"https://github.com/metalculus84/express-jsonschema","_id":"express-jsonschema@0.0.3","_shasum":"7cc456f173e042cc1fe6339ec9931f669fcfd16e","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"7cc456f173e042cc1fe6339ec9931f669fcfd16e","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-0.0.3.tgz","integrity":"sha512-suEyYI/mANOxwDq6acVZV/alT6lJxsJhw+CepYwEYkGpllToE70oxVqQ+M2k2BiMl++G9fHkzCpnfbWa4DYLqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmQL3HAB7CNirFA9PVOQj0wp0rnk2jtuWBqe+ffBf8hgIgaUxoqXEK+H2OyHn6BOkUqytQHjqZrIB8SqFiiFnnl6k="}]},"directories":{}},"1.0.0":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"1.0.0","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/trainiac/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0"},"devDependencies":{"body-parser":"^1.11.0","express":"^4.11.2","istanbul":"^0.3.5","merge":"^1.2.0","mocha":"^2.1.0","should":"^4.6.1","supertest":"^0.15.0"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"b4abe87a7a083ec7a2688e59deea3d3f91f10932","bugs":{"url":"https://github.com/trainiac/express-jsonschema/issues"},"homepage":"https://github.com/trainiac/express-jsonschema","_id":"express-jsonschema@1.0.0","_shasum":"5c05487e2bef9cf89673596bddf1346aad5cec34","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"5c05487e2bef9cf89673596bddf1346aad5cec34","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-1.0.0.tgz","integrity":"sha512-J/KddkwdBgbXoiTwKYr5U9dBNzwP1eoYwlZY/RVEB/0EBNlDXUKSXbeDnhIbuCatSGEp7e8LWH1BOKi4pPMy4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUPA1PW/5wK5xJyAoDH5Et7/8K6fj8IBfwl3GOz2yzsAiABJRBqn4tmqi9eXteo1sHMDLZEt4QwgHmNy5/il4EY4g=="}]},"directories":{}},"1.0.1":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"1.0.1","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/trainiac/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0"},"devDependencies":{"body-parser":"^1.11.0","express":"^4.11.2","istanbul":"^0.3.5","merge":"^1.2.0","mocha":"^2.1.0","should":"^4.6.1","supertest":"^0.15.0"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"867801d1ca2cf25187c588bb72fb8d00b4cdad9b","bugs":{"url":"https://github.com/trainiac/express-jsonschema/issues"},"homepage":"https://github.com/trainiac/express-jsonschema","_id":"express-jsonschema@1.0.1","_shasum":"3deae244f0eb98530f704f564fa77fcc849d3b00","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"3deae244f0eb98530f704f564fa77fcc849d3b00","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-1.0.1.tgz","integrity":"sha512-VqBqj8PWxcBA822Ea/wFhzXoe2Wsu/Ft7/ZSXuDKwHOrQzOxDPwjJl+lcnRZl+QGH1iZcZ1xgSRZ8LatUj+QaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHeSGKpR/SRkl0AyU8IAk6bXPXAnHWXJ45iBsF6DtW5jAiAyQG3wANwwAyU0orT9NqYQoJciK4IDbtTj6GDJLhHIyw=="}]},"directories":{}},"1.0.2":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"1.0.2","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/trainiac/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0"},"devDependencies":{"body-parser":"^1.11.0","express":"^4.11.2","istanbul":"^0.3.5","merge":"^1.2.0","mocha":"^2.1.0","should":"^4.6.1","supertest":"^0.15.0"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"7bb73a3b1ba9e533c41ed06d4fb27b6d62943fe5","bugs":{"url":"https://github.com/trainiac/express-jsonschema/issues"},"homepage":"https://github.com/trainiac/express-jsonschema","_id":"express-jsonschema@1.0.2","_shasum":"cd1b332a23601cc7e50662a2da48caa0ef226efa","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"cd1b332a23601cc7e50662a2da48caa0ef226efa","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-1.0.2.tgz","integrity":"sha512-QXzR9sXBrgdRz0ZAmkjZyHkkJ0ccKWhMdOHTNaB0JGHS+Oz/NqlrEpqqTfVVSZqh56M8WYaAq1QRioisLkd9vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLfqgMeB+JenpSfLSjRbIEPuJki3frXzlZmDIg0LDXmAIhAL5R3nn7DZpk1PVZo+whhMttTf12gP65QmvGJJsefnr6"}]},"directories":{}},"1.1.0":{"name":"express-jsonschema","description":"Express middleware for jsonchema validation.","version":"1.1.0","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/trainiac/express-jsonschema.git"},"keywords":["express","jsonchema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0"},"devDependencies":{"body-parser":"^1.11.0","express":"^4.11.2","istanbul":"^0.3.5","merge":"^1.2.0","mocha":"^2.1.0","should":"^4.6.1","supertest":"^0.15.0"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"558c54cb64341a6f0da1101802b41f8791e071f8","bugs":{"url":"https://github.com/trainiac/express-jsonschema/issues"},"homepage":"https://github.com/trainiac/express-jsonschema","_id":"express-jsonschema@1.1.0","_shasum":"2d36ea1e15127719e1e6a95a16eb7d5e68f7d0fd","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"dist":{"shasum":"2d36ea1e15127719e1e6a95a16eb7d5e68f7d0fd","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-1.1.0.tgz","integrity":"sha512-PdAEZF4NVc6K33vKsm/7xIBZGqG/6Z8SV8BFNV81pZCWfxYSMRjAYEuh23hlR+e4wBmEqpO0zglzemRmgsr8Zg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4WhWRH5UQd1lEr+IkrPzZF5u8DZ7Wccs/vvpOHVlhtAiABbwZCCQbUnm5MZ3TzbKuuY6DVK6c90VsmFHMemKKjiw=="}]},"directories":{}},"1.1.5":{"name":"express-jsonschema","description":"Express middleware for jsonschema validation.","version":"1.1.5","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/trainiac/express-jsonschema.git"},"keywords":["express","jsonschema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0"},"devDependencies":{"body-parser":"^1.11.0","express":"^4.11.2","istanbul":"^0.3.5","merge":"^1.2.0","mocha":"^2.1.0","should":"^4.6.1","sinon":"^1.17.6","supertest":"^0.15.0"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"75ec30a9378dc61dc1a93c5ea2cef7e06df1b8d9","bugs":{"url":"https://github.com/trainiac/express-jsonschema/issues"},"homepage":"https://github.com/trainiac/express-jsonschema#readme","_id":"express-jsonschema@1.1.5","_shasum":"bdfe0d61fb16bd6a092c65f1e371b18b2a6911aa","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"dist":{"shasum":"bdfe0d61fb16bd6a092c65f1e371b18b2a6911aa","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-1.1.5.tgz","integrity":"sha512-e3ANO/iiqZl89MMR0xbwHgH14gpkJp9S3t6Iyf1pOil8p/+aDCEUhaMylFg8hVBhB9BKLWmUM5xZ/x7yEad+nQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbCANMxY5Sa/3r0If3768A5cWgy/OhLl+2EeKF1ZN7rAiEAmLxJRz/iiNYtQR99UQnwZa8maLHfL+GSGy3rPUmYBJM="}]},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/express-jsonschema-1.1.5.tgz_1475004504808_0.9872714222874492"},"directories":{}},"1.1.6":{"name":"express-jsonschema","description":"Express middleware for jsonschema validation.","version":"1.1.6","author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"licenses":"MIT","repository":{"type":"git","url":"git://github.com/trainiac/express-jsonschema.git"},"keywords":["express","jsonschema","validation","validate"],"dependencies":{"jsonschema":"^1.0.0"},"devDependencies":{"body-parser":"^1.11.0","express":"^4.11.2","istanbul":"^0.3.5","merge":"^1.2.0","mocha":"^2.1.0","should":"^4.6.1","sinon":"^1.17.6","supertest":"^0.15.0"},"main":"./index.js","engines":{"node":">= 0.8"},"scripts":{"test":"mocha","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"7e2b5973e68341e64f1c54714629d33fc3906c02","bugs":{"url":"https://github.com/trainiac/express-jsonschema/issues"},"homepage":"https://github.com/trainiac/express-jsonschema#readme","_id":"express-jsonschema@1.1.6","_shasum":"fd9d0667ecbb51430e326e9f620372a23136faef","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"trainiac","email":"adkison.adrian@gmail.com"},"dist":{"shasum":"fd9d0667ecbb51430e326e9f620372a23136faef","tarball":"https://registry.npmjs.org/express-jsonschema/-/express-jsonschema-1.1.6.tgz","integrity":"sha512-umetb7SHkNL5RWJw3zTGHG0bmooaIgdQJ4NW2193iwXfHXrNg9rbm2nS96jUOPj2OSqgcKktINkHg2tbZpB2dQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZJWhJuEQMQHmMIryIpOPhyQdOAu1E8jrevBCTqzTTwgIgEHLdDjVImM3DJp7PU/2ICt46B0Yv2577sZ6/nX1xCKA="}]},"maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/express-jsonschema-1.1.6.tgz_1475160820538_0.9137233134824783"},"directories":{}}},"readme":"# express-jsonschema\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\n[express.js]( https://github.com/visionmedia/express ) middleware for JSON schema validation.\n\n## Why validate with express-jsonschema?\n\n- It makes setting up request validation simple and gets out of your way.\n- It makes no assumptions about how you want to handle invalid data. Response status codes, message formatting, content type, and logging strategies are not one size fits all.\n- It leverages the [jsonschema][jsonschema-url] library to conduct JSON schema validation. `jsonschema` is popular (10K+ downloads / week) and adheres to the latest IETF published v4 draft of JSON schema.\n\n## Why validate with JSON schemas?\n\n- **Simple** - JSON schemas are a simple and expressive way to describe a data structure that your API expects.\n- **Standard** - JSON schemas are not specific to javascript. They are used in many server side languages. The standard specification lives here [json-schema.org][json-schema-url].\n- **Fail-Fast** - Validating a payload before handing it to your application code will catch errors early that would otherwise lead to more confusing errors later.\n- **Separate Validation** - Manually inspecting a payload for errors can get lengthy and clutter up your application code.\n- **Error Messaging** -  Coming up with error messaging for every validation error becomes tedious and inconsistent.\n- **Documentation** - Creating a JSON schema helps document the API requirements.\n\n## Installation\n\n```sh\n$ npm install express-jsonschema\n```\n\n## Example\n\n```js\nvar express = require('express');\nvar app = express();\nvar validate = require('express-jsonschema').validate;\nvar bodyParser = require('body-parser');\n\n// Create a json scehma\nvar StreetSchema = {\n    type: 'object',\n    properties: {\n        number: {\n            type: 'number',\n            required: true\n        },\n        name: {\n            type: 'string',\n            required: true\n        },\n        type: {\n            type: 'string',\n            required: true\n            enum: ['Street', 'Avenue', 'Boulevard']\n        }\n    }\n}\n\n// This route validates req.body against the StreetSchema\napp.post('/street/', validate({body: StreetSchema}), function(req, res) {\n    // At this point req.body has been validated and you can\n    // begin to execute your application code\n});\n\n/*\n    Setup a general error handler for JsonSchemaValidation errors.\n    As mentioned before, how one handles an invalid request depends on their application.\n    You can easily create some express error middleware\n    (http://expressjs.com/guide/error-handling.html) to customize how your\n    application behaves. When the express-jsonschema.validate middleware finds invalid data it\n    passes an instance of JsonSchemaValidation to the next middleware.\n    Below is an example of a general JsonSchemaValidation error handler for\n    an application.\n*/\napp.use(function(err, req, res, next) {\n\n    var responseData;\n\n    if (err.name === 'JsonSchemaValidation') {\n        // Log the error however you please\n        console.log(err.message);\n        // logs \"express-jsonschema: Invalid data found\"\n\n        // Set a bad request http response status or whatever you want\n        res.status(400);\n\n        // Format the response body however you want\n        responseData = {\n           statusText: 'Bad Request',\n           jsonSchemaValidation: true,\n           validations: err.validations  // All of your validation information\n        };\n\n        // Take into account the content type if your app serves various content types\n        if (req.xhr || req.get('Content-Type') === 'application/json') {\n            res.json(responseData);\n        } else {\n            // If this is an html request then you should probably have\n            // some type of Bad Request html template to respond with\n            res.render('badrequestTemplate', responseData);\n        }\n    } else {\n        // pass error to next error middleware handler\n        next(err);\n    }\n});\n\napp.use(bodyParser.json());\napp.listen(8080, function(){\n    console.log('app is running')\n});\n```\n\n## Request\n\n```\n$ curl -H \"Content-Type: application/json\" -X POST -d '{ \"number\": \"12\", \"type\": \"Drive\"}' http://localhost:8080/street/\n```\n\n## Response\n\n```js\n{\n    \"statusText\":\"Bad Request\",\n    \"jsonSchemaValidation\":true,\n    \"validations\":{\n        \"body\":[{\n            \"value\":\"12\",\n            \"property\":\"request.body.number\",\n            \"messages\":[\"is not of a type(s)number\"]\n        }, {\n           \"property\":\"request.body.name\",\n           \"messages\":[\"is required\"]\n        }, {\n           \"value\":\"Drive\",\n           \"property\":\"request.body.type\",\n           \"messages\":[\"is not one of enum values: Street,Avenue,Boulevard\"]\n        }]\n    }\n}\n```\n\n## Validating multiple request properties\n\nSometimes your route may depend on the `body` and `query` both having a specific format.  In this\nexample I use `body` and `query` but you can choose to validate any `request` properties you'd like.\n\n```js\nvar TokenSchema = {\n    type: 'object',\n    properties: {\n        token: {\n            type: 'string',\n            format: 'alphanumeric',\n            minLength: 10,\n            maxLength: 10,\n            required: true\n        }\n    }\n}\n\napp.post('/street/', validate({body: StreetSchema, query: TokenSchema}), function(req, res) {\n    // application code\n});\n```\n\nA valid request would now also require a url like `/street/?token=F42G5N5BGC`.\n\n\n## Creating custom schema properties\n\nWhile JSON schema comes with a lot of validation properties out of the box, you may want to add your own\ncustom properties. `addSchemaProperties` allows you to extend the validation properties that can be used in your\nschemas. It should be called once at the beginning of your application so that your schemas will\nhave the custom properties available.\n\n```javascript\nvar addSchemaProperties = require('express-jsonschema').addSchemaProperties;\n\naddSchemaProperties({\n    contains: function(value, schema){\n        ...\n    },\n    isDoubleQuoted: function(value, schema){\n        ...\n    }\n});\n```\nSee [jsonschema's how to create custom properties](https://github.com/tdegrunt/jsonschema#custom-properties).\n\n## Complex example, with split schemas and references\n\n```js\nvar express = require('express');\nvar app = express();\nvar validate = require('express-jsonschema').validate;\n\n// Address, to be embedded on Person\nvar AddressSchema = {\n    \"id\": \"/SimpleAddress\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"street\": {\"type\": \"string\"},\n        \"zip\": {\"type\": \"string\"},\n        \"city\": {\"type\": \"string\"},\n        \"state\": {\"type\": \"string\"},\n        \"country\": {\"type\": \"string\"}\n    }\n};\n\n// Person\nvar PersonSchema = {\n    \"id\": \"/SimplePerson\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"name\": {\"type\": \"string\"},\n        \"address\": {\"$ref\": \"/SimpleAddress\"}\n    }\n};\n\napp.post('/person/', validate({body: PersonSchema}, [AddressSchema]), function(req, res) {\n    // application code\n});\n```\n\nA valid post body:\n\n```json\n{\n    \"name\": \"Barack Obama\",\n    \"address\": {\n        \"street\": \"1600 Pennsylvania Avenue Northwest\",\n        \"zip\": \"20500\",\n        \"city\": \"Washington\",\n        \"state\": \"DC\",\n        \"country\": \"USA\"\n    }\n}\n```\n\n## More documentation on JSON schemas\n\n- [scpacetelescope's understanding json schema](http://spacetelescope.github.io/understanding-json-schema/)\n- [jsonschema][jsonschema-url]\n- [json-schema.org][json-schema-url]\n- [json schema generator](http://jsonschema.net/)\n- [json schema google group](https://groups.google.com/forum/#!forum/json-schema)\n\n## Notes\n\nYou can declare that something is required in your schema in two ways.\n\n```js\n{\n    type: 'object',\n    properties: {\n        foo: {\n            type: 'string',\n            required: true\n        }\n    }\n}\n\n// OR\n\n{\n    type: 'object',\n    properties: {\n        foo: {\n            type: 'string'\n        },\n        required: ['foo']\n    }\n}\n```\nThe first method works as expected with [jsonschema][jsonschema-url]. The second way has a few gotchas. I recommend using the first.\n\n## Tests\nTests are written using [mocha](https://www.npmjs.com/package/mocha), [should](https://www.npmjs.com/package/should),\nand [supertest](https://www.npmjs.com/package/supertest).\n\n    npm test\n\n## License\n\n    express-jsonschema is licensed under MIT license.\n\n    Copyright (C) 2015 Adrian Adkison <adkison.adrian@gmail.com>\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy of\n    this software and associated documentation files (the \"Software\"), to deal in\n    the Software without restriction, including without limitation the rights to\n    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n    of the Software, and to permit persons to whom the Software is furnished to do\n    so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n\n\n[npm-image]: https://img.shields.io/npm/v/express-jsonschema.svg?style=flat\n[npm-url]: https://npmjs.org/package/express-jsonschema\n[travis-image]: https://img.shields.io/travis/trainiac/express-jsonschema.svg?style=flat\n[travis-url]: https://travis-ci.org/trainiac/express-jsonschema\n[coveralls-image]: https://img.shields.io/coveralls/trainiac/express-jsonschema.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/trainiac/express-jsonschema?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/express-jsonschema.svg?style=flat\n[downloads-url]: https://npmjs.org/package/express-jsonschema\n[json-schema-url]: http://json-schema.org/\n[jsonschema-url]: https://github.com/tdegrunt/jsonschema\n","maintainers":[{"name":"trainiac","email":"adkison.adrian@gmail.com"}],"time":{"modified":"2022-06-17T22:23:10.515Z","created":"2015-01-28T11:37:07.714Z","0.0.0":"2015-01-28T11:37:07.714Z","0.0.1":"2015-01-28T11:37:27.188Z","0.0.2":"2015-01-28T11:56:21.602Z","0.0.3":"2015-01-28T11:59:15.450Z","1.0.0":"2015-02-02T00:57:31.976Z","1.0.1":"2015-02-02T20:39:45.815Z","1.0.2":"2015-02-07T01:10:34.506Z","1.1.0":"2015-07-06T23:36:15.953Z","1.1.5":"2016-09-27T19:28:26.720Z","1.1.6":"2016-09-29T14:53:42.603Z"},"homepage":"https://github.com/trainiac/express-jsonschema#readme","keywords":["express","jsonschema","validation","validate"],"repository":{"type":"git","url":"git://github.com/trainiac/express-jsonschema.git"},"author":{"name":"Adrian Adkison","email":"adkison.adrian@gmail.com"},"bugs":{"url":"https://github.com/trainiac/express-jsonschema/issues"},"readmeFilename":"README.md","users":{"kodekracker":true,"slurm":true,"sergiosdlima":true,"leonzhao":true,"miloc":true,"rocket0191":true,"ngnmhieu":true,"morsellif":true,"rahulraghavankklm":true,"shubhambansal013":true,"mateussampsouza":true}}