{"_id":"json-schema-compatibility","_rev":"7-4404e2dce6425b977817646c0e10045c","name":"json-schema-compatibility","description":"JSON Schema tools are now being written for v4 of the draft, but v3 schemas still exist out in the wild.","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"json-schema-compatibility","version":"1.0.0","author":{"name":"Geraint Luff"},"description":"JSON Schema tools are now being written for v4 of the draft, but v3 schemas still exist out in the wild.","keywords":["json","json-schema","schema","compatibility"],"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"main":"main.js","license:":[{"type":"MIT","url":"http://jsonary.com/LICENSE.txt"}],"devDependencies":{"grunt":"~0.4.1","grunt-mocha-test":"~0.7.0","chai":"~1.8.1"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"dependencies":{},"_id":"json-schema-compatibility@1.0.0","dist":{"shasum":"b8ac91a348f588826a2383f45ecac4e38afa21a8","tarball":"https://registry.npmjs.org/json-schema-compatibility/-/json-schema-compatibility-1.0.0.tgz","integrity":"sha512-bKuiKGmJZjQwKjGEBP714bLL9R9D/vdj2+6lMgjVweMMVfWzacVyzYMTZQYge1IhKjfVv1UP3H5epJZ+B0rnmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHnslP5btlIScb07YZ7yj/V/hCUaeDVtehJnRz1DZHUzAiAnBKOi2qFRAkATV5Hl83d5YWymJU4pVAjiBPiZEz2vDw=="}]},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"}},"1.0.1":{"name":"json-schema-compatibility","version":"1.0.1","author":{"name":"Geraint Luff"},"description":"JSON Schema tools are now being written for v4 of the draft, but v3 schemas still exist out in the wild.","keywords":["json","json-schema","schema","compatibility"],"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"main":"main.js","license:":[{"type":"MIT","url":"http://jsonary.com/LICENSE.txt"}],"devDependencies":{"grunt":"~0.4.1","grunt-mocha-test":"~0.7.0","chai":"~1.8.1"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"dependencies":{},"_id":"json-schema-compatibility@1.0.1","dist":{"shasum":"8e9c3e6c74d8b8c79dc15c605dcda9b171021fa9","tarball":"https://registry.npmjs.org/json-schema-compatibility/-/json-schema-compatibility-1.0.1.tgz","integrity":"sha512-InxraHhJMzqKRdV9B32ynlVDGNZ27mkHL7wHVef/8N3C4unX5bV05xWm10jNeRQfbXwAhjzpXUCxE5HKEYtSyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDoBVKgv4oN0c1zcQ7I3P35H/Sxf03wKgefGJCojSSeEAiEAqzHp7wMdSHcJksgFFFGPPQHEcQacfmT9mac739cg4J8="}]},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"}},"1.1.0":{"name":"json-schema-compatibility","version":"1.1.0","author":{"name":"Geraint Luff"},"description":"JSON Schema tools are now being written for v4 of the draft, but v3 schemas still exist out in the wild.","keywords":["json","json-schema","schema","compatibility"],"maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"main":"main.js","license:":[{"type":"MIT","url":"http://jsonary.com/LICENSE.txt"}],"devDependencies":{"grunt":"~0.4.1","grunt-mocha-test":"~0.7.0","chai":"~1.8.1"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"dependencies":{},"_id":"json-schema-compatibility@1.1.0","dist":{"shasum":"1a8981778cda0c38187298d999d089e51af282df","tarball":"https://registry.npmjs.org/json-schema-compatibility/-/json-schema-compatibility-1.1.0.tgz","integrity":"sha512-/ZDuZvZFAi9XnuVQHdUlUvHSxN/ksFn8KDVHiLUJWumpRagccER/tRNY1GKNMguYdJCjaTZweTjf1faugxFfjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGIAkJRAS50Q2SiKZOTrXdJMn5o0F5O5couRoGcOAhKgIgc743Ha2BgDfKo1EWCXKgao5iFSY1pUs3obzwQ1NvChA="}]},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"geraintluff","email":"luffgd@gmail.com"}}},"readme":"# JSON Schema compatibility\n\nJSON Schema tools are now being written for v4 of the draft, but v3 schemas still exist out in the wild.\n\nThis project intends to be a converter that updates schemas to be compatible with v4 of the spec.\n\n## Behaviour\n\nThis tool works \"in-place\" - so it actually modifies the JavaScript objects representing the schema.  This is simply because it's easier than cloning the data or anything like that.\n\nThis tool should also not modify schemas that are already compatible, and can even (in some cases) handle horrible merged combinations (e.g. mixed boolean/array use of `required`).\n\n## Usage (Node):\n\nInstall using npm:\n\n```shell\nnpm install json-schema-compatibility\n```\n\nConvert a schema:\n\n```\nvar api = require('json-schema-compatibility');\n\napi.v4(oldSchema);\n```\n\n## Usage (browser)\n\nThis has not been thoroughly tested, but it should make the API available as a global `JsonSchemaCompatibility` variable.\n\nYou might need a shim to get it to work in older browsers (due to use of `Array.isArray()` etc), but I'd imagine any JSON Schema validator would already include/require that.\n\n## Combination with other packages\n\nThe idea is that you can take your v3 schemas, and pass them through this tool before handing them to a v4 utility.  For instance, using tv4:\n\n```javascript\nvar oldSchema = {\"type\": \"number\", \"divisibleBy\": 1.5};\nvar v4Schema = JsonSchemaCompatibility.v4(oldSchema);\n\ntv4.validate(data, v4Schema);\n```\n\n## License\n\nThe code is available as \"public domain\", meaning that it is completely free to use, without any restrictions at all.  Read the full license [here](http://geraintluff.github.com/tv4/LICENSE.txt).\n\nIt's also available under an [MIT license](http://jsonary.com/LICENSE.txt).\n","maintainers":[{"name":"geraintluff","email":"luffgd@gmail.com"}],"time":{"modified":"2022-06-19T06:23:32.804Z","created":"2014-10-06T15:19:39.353Z","1.0.0":"2014-10-06T15:19:39.353Z","1.0.1":"2014-10-06T15:28:27.726Z","1.1.0":"2015-07-29T13:30:59.041Z"},"keywords":["json","json-schema","schema","compatibility"],"author":{"name":"Geraint Luff"},"readmeFilename":"README.md"}