{"id":14062818,"url":"https://github.com/acornejo/jjv","last_synced_at":"2026-02-19T22:33:34.682Z","repository":{"id":11010047,"uuid":"13336001","full_name":"acornejo/jjv","owner":"acornejo","description":"Javascript Library for Schema Validation","archived":false,"fork":false,"pushed_at":"2019-11-06T19:00:48.000Z","size":145,"stargazers_count":199,"open_issues_count":18,"forks_count":35,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-01-24T06:05:36.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acornejo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-04T22:20:22.000Z","updated_at":"2025-10-06T09:14:31.000Z","dependencies_parsed_at":"2022-08-07T06:01:01.707Z","dependency_job_id":null,"html_url":"https://github.com/acornejo/jjv","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/acornejo/jjv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acornejo%2Fjjv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acornejo%2Fjjv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acornejo%2Fjjv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acornejo%2Fjjv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acornejo","download_url":"https://codeload.github.com/acornejo/jjv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acornejo%2Fjjv/sbom","scorecard":{"id":163215,"data":{"date":"2025-08-11","repo":{"name":"github.com/acornejo/jjv","commit":"3c481a758e84dab15f0f874ff5a67d06380402f2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"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":"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":"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":4,"reason":"Found 9/22 approved changesets -- score normalized to 4","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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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 17 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-16T14:08:46.072Z","repository_id":11010047,"created_at":"2025-08-16T14:08:46.073Z","updated_at":"2025-08-16T14:08:46.073Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29635630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"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":[],"created_at":"2024-08-13T07:02:30.124Z","updated_at":"2026-02-19T22:33:34.654Z","avatar_url":"https://github.com/acornejo.png","language":"JavaScript","funding_links":[],"categories":["JSON Schema Validators","JavaScript"],"sub_categories":[],"readme":"# JJV: JJV JSON Validator\n\nA simple and extensible json-schema validator written in javascript. JJV\nruns in the browser and in the server (through node.js), it has no\ndependencies and has out-of-the-box AMD support.\n\nJJV implements the latest (v4) JSON Schema Core draft, however due to\nperformance and security concerns remote schemas are not fetched. To\nensure compliance JJV is tested against JSON Schema Test Suite published\nby json-schema.org (and passes all tests). For examples and a detailed\ndescription of the JSON-schema specification visit\n[json-schema.org](http://json-schema.org).\n\nJJV is fast! For a detailed performance comparison visit z-schema's\n[benchmarks](https://rawgithub.com/zaggino/z-schema/master/benchmark/results.html)\nwebsite, which compares various javascript JSON schema validators.\n\n## Basic Usage\n\nIn the most basic usage an environment must be created, and one or more\nnamed schemas are registered in the environment (it is also possible to\nregister schemas with remote URI's in the same way). Javascript\nobjects can then be validated against any registered schema.\n\n```javascript\n// create new JJV environment\nvar env = jjv();\n\n// Register a `user` schema\nenv.addSchema('user', {\n    type: 'object',\n    properties: {\n        firstname: {\n            type: 'string',\n            minLength: 2,\n            maxLength: 15\n        },\n        lastname: {\n            type: 'string',\n            minLength: 2,\n            maxLength: 25\n        },\n        gender: {\n            type: 'string',\n            enum: ['male', 'female']\n        },\n        email: {\n            type: 'string',\n            format: 'email'\n        },\n        password: {\n            type: 'string',\n            minLength: 8\n        }\n    },\n    required: ['firstname', 'lastname', 'email', 'password']\n});\n\n// Perform validation against an incomplete user object (errors will be reported)\nvar errors = env.validate('user', {firstname: 'John', lastname: 'Smith'});\n\n// validation was successful\nif (!errors) {\n    alert('User has been validated.')\n} else {\n    alert('Failed with error object ' + JSON.stringify(errors));\n}\n```\n\nIt is also possible to validate objects against unregistered and/or\nunnamed schemas by supplying the schema object directly. For example:\n\n```javascript\nvar env = jjv();\n\nvar errors = env.validate({\n    type: 'object',\n    properties: {\n        x: {\n            type: 'number'\n        },\n        y: {\n            type: 'number'\n        }\n    },\n    required: ['x', 'y']\n }, {x: 20, y: 50});\n\n```\n\n## Validation Options\n\nJJV provides options to control the validation of required fields, the\nhandling of default values, and the handling of additional properties.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eOption\u003c/th\u003e\n        \u003cth\u003eDefault\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003echeckRequired\u003c/td\u003e\n        \u003ctd\u003etrue\u003c/td\u003e\n        \u003ctd\u003eIf true it reports missing required properties, otherwise it\n        allows missing required properties.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003euseDefault\u003c/td\u003e\n        \u003ctd\u003efalse\u003c/td\u003e\n        \u003ctd\u003eIf true it modifies the object to have the default values for\n        missing non-required fields.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003euseCoerce\u003c/td\u003e\n        \u003ctd\u003efalse\u003c/td\u003e\n        \u003ctd\u003eIf true it enables type coercion where defined.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eremoveAdditional\u003c/td\u003e\n        \u003ctd\u003efalse\u003c/td\u003e\n        \u003ctd\u003eIf true it removes all attributes of an object which are not\n        matched by the schema's specification.\n    \u003c/tr\u003e\n\u003c/table\u003e\n\nThe defaults can be overridden for the entire environment or on a\nper-validation basis. For example, to override the checkRequired option\nfor the entire environment simply do:\n\n```javascript\nenv.defaultOptions.checkRequired=false;\n```\n\nTo override the checkRequired option on a per-validation case do:\n\n```\nenv.validate('schemaName', object, {checkRequired: false});\n```\n\n## Advanced Usage\n\nJJV provides mechanisms to add support for custom types, custom formats,\nand custom checks.\n\n### Custom Types\n\nSupport for additional types can be added through the `addType`\nfunction. For example, a simple implementation of the `date` type could\nbe the following:\n\n```javascript\nenv.addType('date', function (v) {\n  return !isNaN(Date.parse(v));\n});\n```\n\n### Custom Formats\n\nIt is also possible to add support for additional string formats through\nthe `addFormat` function. For example, an implementation of the\n`hexadecimal` string format (already included) could be as follows:\n\n```javascript\nenv.addFormat('hexadecimal', function (v) {\n    return (/^[a-fA-F0-9]+$/).test(v);\n});\n```\n\n### Custom Checks\n\nIt is possible to add support for custom checks (i.e.,\n`minItems`, `maxItems`, `minLength`, `maxLength`, etc.) through the\n`addCheck` function. For example, an implementation for an `exactLength`\nvalidation keyword that supports arrays and strings can be achieved with\nthe following:\n\n```javascript\nenv.addCheck('exactLength', function (v, p) {\n    return v.length === p;\n});\n```\n\n### Custom Type Coercion\n\nJJV allows custom type coercion rules. As an example, supposed that fields\nwhich are declared with as type `integer` are sometimes encoded as a string.\nType coercion allows you to specify that all types declared as `integer` should\nbe cast/coerced to an `integer` before performing validation.\n\n```javascript\nenv.addTypeCoercion('integer', function (x) {\n    return parseInt(x, 10);\n});\n```\n\nRecall to set the option `useCoerce` to `true` to enable this feature.\n\n## $data v5 proposal\n\nJJV supports the `$data` spec proposed for draft 5 of json-schema,\ncomplete with relative and absolute JSON pointers.\n\nFor information on how to use these feature see the proposal here:\n\n[$data-proposal](https://github.com/json-schema/json-schema/wiki/$data-(v5-proposal)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facornejo%2Fjjv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facornejo%2Fjjv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facornejo%2Fjjv/lists"}