{"_id":"json-schema-traverse","_rev":"21976","name":"json-schema-traverse","description":"Traverse JSON Schema passing each schema object to callback","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"esp","email":""}],"time":{"modified":"2021-06-03T10:01:45.000Z","created":"2017-06-04T18:42:17.844Z","1.0.0":"2020-12-13T10:56:54.719Z","0.5.0":"2020-09-05T19:53:20.342Z","0.4.1":"2018-06-10T08:42:05.056Z","0.4.0":"2018-05-08T19:38:06.477Z","0.3.1":"2017-06-23T23:50:57.513Z","0.3.0":"2017-06-15T20:22:58.966Z","0.2.0":"2017-06-14T21:22:49.143Z","0.1.0":"2017-06-05T20:19:20.802Z","0.0.1":"2017-06-04T18:42:17.844Z"},"users":{},"author":{"name":"Evgeny Poberezkin"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"versions":{"1.0.0":{"name":"json-schema-traverse","version":"1.0.0","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","types":"index.d.ts","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"eslint":"^7.3.1","mocha":"^8.0.1","nyc":"^15.0.0","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"6b45983cd76270042cc79527da5c8972f13599ec","_id":"json-schema-traverse@1.0.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"shasum":"ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2","size":6074,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-1.0.0.tgz"},"_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"directories":{},"maintainers":[{"name":"esp","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse_1.0.0_1607857014508_0.11357423963069646"},"_hasShrinkwrap":false,"publish_time":1607857014719,"_cnpm_publish_time":1607857014719},"0.5.0":{"name":"json-schema-traverse","version":"0.5.0","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","types":"index.d.ts","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"coveralls":"^3.0.1","eslint":"^7.3.1","mocha":"^8.0.1","nyc":"^15.0.0","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"666a85fe56ccc27a07f4d40ba52cc172406f8f17","_id":"json-schema-traverse@0.5.0","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"shasum":"1069a6097f9e9a567bfc6cc215e85f606ebf6480","size":5718,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.5.0.tgz"},"maintainers":[{"name":"esp","email":""}],"_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse_0.5.0_1599335600219_0.22633217841346598"},"_hasShrinkwrap":false,"publish_time":1599335600342,"_cnpm_publish_time":1599335600342},"0.4.1":{"name":"json-schema-traverse","version":"0.4.1","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"coveralls":"^2.13.1","eslint":"^3.19.0","mocha":"^3.4.2","nyc":"^11.0.2","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"bc898eeee723833fc9d604523e00014350bcc4e1","_id":"json-schema-traverse@0.4.1","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"dist":{"shasum":"69f6a87d9513ab8bb8fe63bdb0979c448e684660","size":5141,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz"},"maintainers":[{"name":"esp","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse_0.4.1_1528620124976_0.4290201343994062"},"_hasShrinkwrap":false,"publish_time":1528620125056,"_cnpm_publish_time":1528620125056},"0.4.0":{"name":"json-schema-traverse","version":"0.4.0","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"coveralls":"^2.13.1","eslint":"^3.19.0","mocha":"^3.4.2","nyc":"^11.0.2","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"c1fd5208eb7fce760867477aa119c8bb16972df3","_id":"json-schema-traverse@0.4.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"dist":{"shasum":"e8467bf83020ba9d2a47b2e6b82e1ac056b0ad86","size":5124,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.4.0.tgz"},"maintainers":[{"name":"esp","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse_0.4.0_1525808286399_0.5813937245567184"},"_hasShrinkwrap":false,"publish_time":1525808286477,"_cnpm_publish_time":1525808286477},"0.3.1":{"name":"json-schema-traverse","version":"0.3.1","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"coveralls":"^2.13.1","eslint":"^3.19.0","mocha":"^3.4.2","nyc":"^11.0.2","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"f0a6627655525debea519dc8ebb4cf35f3c8e85f","_id":"json-schema-traverse@0.3.1","_shasum":"349a6d44c53a51de89b40805c5d5e59b417d3340","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"maintainers":[{"name":"esp","email":""}],"dist":{"shasum":"349a6d44c53a51de89b40805c5d5e59b417d3340","size":5165,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.3.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse-0.3.1.tgz_1498261856588_0.601617609616369"},"directories":{},"publish_time":1498261857513,"_hasShrinkwrap":false,"_cnpm_publish_time":1498261857513},"0.3.0":{"name":"json-schema-traverse","version":"0.3.0","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"coveralls":"^2.13.1","eslint":"^3.19.0","mocha":"^3.4.2","nyc":"^11.0.2","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"0c2808d402f8d57b6360f24ad8cc0fb0662e17c7","_id":"json-schema-traverse@0.3.0","_shasum":"0016c0b1ca1efe46d44d37541bcdfc19dcfae0db","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"maintainers":[{"name":"esp","email":""}],"dist":{"shasum":"0016c0b1ca1efe46d44d37541bcdfc19dcfae0db","size":18381,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.3.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse-0.3.0.tgz_1497558177644_0.5944948405958712"},"directories":{},"publish_time":1497558178966,"_cnpm_publish_time":1497558178966,"_hasShrinkwrap":false},"0.2.0":{"name":"json-schema-traverse","version":"0.2.0","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"coveralls":"^2.13.1","eslint":"^3.19.0","mocha":"^3.4.2","nyc":"^11.0.2","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"70465d279ff702ae915106cb5bfbd851712d37d0","_id":"json-schema-traverse@0.2.0","_shasum":"486926926c876f74dd0f7d696ad072118c75d03c","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"maintainers":[{"name":"esp","email":""}],"dist":{"shasum":"486926926c876f74dd0f7d696ad072118c75d03c","size":17710,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.2.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse-0.2.0.tgz_1497475368098_0.03620475740171969"},"directories":{},"publish_time":1497475369143,"_hasShrinkwrap":false,"_cnpm_publish_time":1497475369143},"0.1.0":{"name":"json-schema-traverse","version":"0.1.0","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","scripts":{"eslint":"eslint index.js spec","test-spec":"mocha spec -R spec","test":"npm run eslint && nyc npm run test-spec"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","devDependencies":{"coveralls":"^2.13.1","eslint":"^3.19.0","mocha":"^3.4.2","nyc":"^11.0.2","pre-commit":"^1.2.2"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"0d928d60085ef32d11cec52fd2adbb1a9cef80e9","_id":"json-schema-traverse@0.1.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"maintainers":[{"name":"esp","email":""}],"dist":{"shasum":"d88e207b83fd8b71f09f5b0c11734de5a0a2d203","size":4493,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.1.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse-0.1.0.tgz_1496693959875_0.9615707800257951"},"directories":{},"publish_time":1496693960802,"_hasShrinkwrap":false,"_cnpm_publish_time":1496693960802},"0.0.1":{"name":"json-schema-traverse","version":"0.0.1","description":"Traverse JSON Schema passing each schema object to callback","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/json-schema-traverse.git"},"keywords":["JSON-Schema","traverse","iterate"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","gitHead":"c0a0d74b106d56a61e953f5571ff42739b4ca3dd","_id":"json-schema-traverse@0.0.1","_shasum":"d241e25481ad2fe8a1fdef61240d727fdee61283","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"maintainers":[{"name":"esp","email":""}],"dist":{"shasum":"d241e25481ad2fe8a1fdef61240d727fdee61283","size":1611,"noattachment":false,"key":"/json-schema-traverse/-/json-schema-traverse-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-schema-traverse/download/json-schema-traverse-0.0.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-traverse-0.0.1.tgz_1496601736961_0.5534928701817989"},"directories":{},"publish_time":1496601737844,"_cnpm_publish_time":1496601737844,"_hasShrinkwrap":false}},"readme":"# json-schema-traverse\nTraverse JSON Schema passing each schema object to callback\n\n[![build](https://github.com/epoberezkin/json-schema-traverse/workflows/build/badge.svg)](https://github.com/epoberezkin/json-schema-traverse/actions?query=workflow%3Abuild)\n[![npm](https://img.shields.io/npm/v/json-schema-traverse)](https://www.npmjs.com/package/json-schema-traverse)\n[![coverage](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master)\n\n\n## Install\n\n```\nnpm install json-schema-traverse\n```\n\n\n## Usage\n\n```javascript\nconst traverse = require('json-schema-traverse');\nconst schema = {\n  properties: {\n    foo: {type: 'string'},\n    bar: {type: 'integer'}\n  }\n};\n\ntraverse(schema, {cb});\n// cb is called 3 times with:\n// 1. root schema\n// 2. {type: 'string'}\n// 3. {type: 'integer'}\n\n// Or:\n\ntraverse(schema, {cb: {pre, post}});\n// pre is called 3 times with:\n// 1. root schema\n// 2. {type: 'string'}\n// 3. {type: 'integer'}\n//\n// post is called 3 times with:\n// 1. {type: 'string'}\n// 2. {type: 'integer'}\n// 3. root schema\n\n```\n\nCallback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is.  Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed.\n\nCallback is passed these parameters:\n\n- _schema_: the current schema object\n- _JSON pointer_: from the root schema to the current schema object\n- _root schema_: the schema passed to `traverse` object\n- _parent JSON pointer_: from the root schema to the parent schema object (see below)\n- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.)\n- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema\n- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'`\n\n\n## Traverse objects in all unknown keywords\n\n```javascript\nconst traverse = require('json-schema-traverse');\nconst schema = {\n  mySchema: {\n    minimum: 1,\n    maximum: 2\n  }\n};\n\ntraverse(schema, {allKeys: true, cb});\n// cb is called 2 times with:\n// 1. root schema\n// 2. mySchema\n```\n\nWithout option `allKeys: true` callback will be called only with root schema.\n\n\n## Enterprise support\n\njson-schema-traverse package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-json-schema-traverse?utm_source=npm-json-schema-traverse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.\n\n\n## Security contact\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.\n\n\n## License\n\n[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE)\n","_attachments":{},"homepage":"https://github.com/epoberezkin/json-schema-traverse#readme","bugs":{"url":"https://github.com/epoberezkin/json-schema-traverse/issues"},"license":"MIT"}