{"id":24440851,"url":"https://github.com/bali182/json-schema-visitor","last_synced_at":"2026-05-06T17:33:52.437Z","repository":{"id":57285237,"uuid":"86059107","full_name":"bali182/json-schema-visitor","owner":"bali182","description":"Visitor for inspecting JSON schemas","archived":false,"fork":false,"pushed_at":"2017-04-07T16:57:13.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-08T13:04:35.489Z","etag":null,"topics":["json","json-schema","schema","visitor"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bali182.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-24T11:04:15.000Z","updated_at":"2017-04-11T09:30:49.000Z","dependencies_parsed_at":"2022-09-18T14:14:12.215Z","dependency_job_id":null,"html_url":"https://github.com/bali182/json-schema-visitor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bali182/json-schema-visitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bali182%2Fjson-schema-visitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bali182%2Fjson-schema-visitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bali182%2Fjson-schema-visitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bali182%2Fjson-schema-visitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bali182","download_url":"https://codeload.github.com/bali182/json-schema-visitor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bali182%2Fjson-schema-visitor/sbom","scorecard":{"id":224612,"data":{"date":"2025-08-11","repo":{"name":"github.com/bali182/json-schema-visitor","commit":"a2df8294cb8ee8fac7cdf8865fc12e3e6a0cf02e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T03:25:13.529Z","repository_id":57285237,"created_at":"2025-08-17T03:25:13.529Z","updated_at":"2025-08-17T03:25:13.529Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32061251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","json-schema","schema","visitor"],"created_at":"2025-01-20T20:57:44.167Z","updated_at":"2026-05-06T17:33:52.415Z","avatar_url":"https://github.com/bali182.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-schema-visitor [![Build Status](https://travis-ci.org/bali182/json-schema-visitor.svg?branch=master)](https://travis-ci.org/bali182/json-schema-visitor)\n\nA package for inspecting JSON schemas. \n\n## Supported schema types\n\nThese directly translate to the method names you need to supply to the configuration object passed to `createVisitor`:\n\n- `object`\n- `array`\n- `enum`\n- `boolean`\n- `number`\n- `null`\n- `string`\n- `oneOf`\n- `anyOf`\n- `allOf`\n- `ref`\n- `unknown`\n\n\n## Usage\n\n### Simple example\n\n```js\nimport createVisitor from 'json-schema-visitor'\n\nconst visitor = createVisitor({\n  object(schema) {\n    return `An object schema: ${JSON.stringify(schema)}`\n  }\n  array(schema) {\n    return `An array schema: ${JSON.stringify(schema)}`\n  }\n})\n\n// 2 cases handled\nexpect(visitor({ type: 'object' })).toBe('An object schema: {type:\"object\"}')\nexpect(visitor({ type: 'array' })).toBe('An array schema: {type:\"array\"}')\n\n// All other cases\nexpect(visitor({ type: 'string' })).toBeUndefined()\nexpect(visitor(null)).toBeUndefined()\nexpect(visitor('foo')).toBeUndefined()\n```\n\n### Default visit method\n\nYou don't have to specify each visit method. You can have a fallback method named `any` which handles all unhandled cases.\n\n```js\nconst visitor = createVisitor({\n  object(schema) {\n    return 'An object schema'\n  },\n  any(schema) {\n    return 'Everything else'\n  }\n})\n\n// Case handled\nexpect(visitor({ type: 'object' })).toBe('An object schema')\n\n// All other cases\nexpect(visitor({ type: 'string' })).toBe('Everything else')\nexpect(visitor(null)).toBe('Everything else')\nexpect(visitor('foo')).toBe('Everything else')\n```\n\n### Extra arguments\n\nYou can pass extra arguments to the visitor. These arguments will be paseed as second, third, etc. arguments to each visit method.\n\n```js\nconst visitor = createVisitor({\n  object(schema, someArg, otherArg) {\n    return `An object schema. Also args: ${someArg} and ${otherArg}`\n  }\n})\n\nexpect(visitor({ type: 'object' }, 'foo', 42)).toBe('An object schema. Also args: foo and 42')\n```\n\n### Recursive traversing\n\nThis visitor recursively visits every element of the schema, and applies a callback on them.\n\n```js\nconst visitor = createVisitor({\n  object(schema, callback) {\n    callback(schema)\n    Object.keys(schema.properties)\n      .map(key =\u003e schema.properties[key])\n      .forEach(childSchema =\u003e visitor(childSchema, callback))\n  }\n  array(schema, callback) {\n    callback(schema)\n    visitor(schema.items, callback)\n  },\n  allOf(schema, callback) {\n    callback(schema)\n    schema.allOf.forEach(childSchema =\u003e visitor(childSchema, callback))\n  },\n  anyOf(schema, callback) {\n    callback(schema)\n    schema.anyOf.forEach(childSchema =\u003e visitor(childSchema, callback))\n  },\n  oneOf(schema, callback) {\n    callback(schema)\n    schema.oneOf.forEach(childSchema =\u003e visitor(childSchema, callback))\n  }\n  any(schema, callback) {\n    callback(schema)\n  }\n})\n\nvisitor(someSchema, schema =\u003e console.log(schema))\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbali182%2Fjson-schema-visitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbali182%2Fjson-schema-visitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbali182%2Fjson-schema-visitor/lists"}