{"id":20460944,"url":"https://github.com/ericgj/json-schema-agent","last_synced_at":"2025-10-26T13:46:45.829Z","repository":{"id":10565990,"uuid":"12769976","full_name":"ericgj/json-schema-agent","owner":"ericgj","description":"JSON Hyper-Schema HTTP client","archived":false,"fork":false,"pushed_at":"2013-11-26T21:27:38.000Z","size":316,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T13:46:45.411Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericgj.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","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":"2013-09-11T23:01:26.000Z","updated_at":"2016-11-16T18:35:48.000Z","dependencies_parsed_at":"2022-09-18T20:22:04.703Z","dependency_job_id":null,"html_url":"https://github.com/ericgj/json-schema-agent","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/ericgj/json-schema-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fjson-schema-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fjson-schema-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fjson-schema-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fjson-schema-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericgj","download_url":"https://codeload.github.com/ericgj/json-schema-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Fjson-schema-agent/sbom","scorecard":{"id":380296,"data":{"date":"2025-08-11","repo":{"name":"github.com/ericgj/json-schema-agent","commit":"6235c3c6a9741990f4e61363235129f9297f3b69"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-18T15:16:50.861Z","repository_id":10565990,"created_at":"2025-08-18T15:16:50.862Z","updated_at":"2025-08-18T15:16:50.862Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281114862,"owners_count":26446042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-15T12:22:34.810Z","updated_at":"2025-10-26T13:46:45.793Z","avatar_url":"https://github.com/ericgj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# json-schema-agent\n\n  **Please note this library is not ready for production use.**\n\n  JSON Hyper-Schema HTTP REST client. Together with [json-schema-core][core] \n  and [json-schema-hyper][hyper], this library provides a basic mechanism for\n  correlating instances with schema over HTTP. It also provides validation \n  of request and response messages (`schema` and `targetSchema`), if \n  [json-schema-valid][valid] is used. \n  \n  Refer to the JSON Schema [Core v4][speccore] and [Hyper-Schema][spechyper] \n  IETF Internet Draft specs for more info.\n\n\n## Installation\n\ncomponent:\n\n    $ component install ericgj/json-schema-agent\n\nnpm:\n\n    $ npm install json-schema-agent-component\n\n\n## Examples\n\n  ```javascript\n\n  // Simple GET\n\n  var agent = new Agent();\n  agent.get('http://some.uri/path', function(err,correlation){\n    correlation.instance  // the JSON instance (parsed body of response)\n    correlation.schema    // the schema\n  })\n\n\n  // POST using link attributes\n\n  var link = { href: 'http://example.com/thing',\n               rel: 'create',\n               mediaType: 'application/vnd.thing+json'\n             }\n\n  agent.post(link, obj, fn);\n\n  // or automatically follow method defined in link\n\n  link.method = 'POST'\n  agent.follow(link, obj, fn);\n\n\n  // follow chain of links\n\n  agent.follow(link, function(err, correlation){\n    var nextItem = correlation.rel('next');  // find link rel=\"next\" in the schema\n    agent.follow(nextItem, fn)\n  })\n\n  \n  // fetch and dereference schema from link\n  // note schema is cached to the agent\n  \n  agent.getSchema(link, function(err,schema){\n    schema    // the parsed, dereferenced schema\n  })\n\n  \n  // dereference raw schema object\n  \n  agent.dereference(data, function(err,schema){\n    schema    // the parsed, dereferenced schema\n  })\n\n\n  // Configuration\n \n  // set default base uri for resolving relative URIs in links\n  // in-browser, typically you'd want to set this to window.location.origin\n\n  agent.base('http://example.com/api'); \n  \n\n  // set underlying http client (class)\n  var httpClient = require('superagent');\n  Agent.service(httpClient);\n\n\n  ```\n\n## API\n\n   \n## Running tests\n\n### In browser:\n\n1. Unit tests: \n  - browse to file:// `test/index.html`\n  - browse to file:// `test/refs.html`\n\n2. Functional tests:\n\n  ```sh\n  $ node test/server.js\n  ```\n  And browse to `http://localhost:3000/functional.html`\n\n\n### In Node-land:\n\n1. Unit tests:\n  \n  ```sh\n  $ npm test\n  ```\n\n2. Functional tests:\n\n  ```sh\n  $ node test/server.js \u0026\n  $ mocha --ui bdd test/functional.js\n  ```\n\n## Notes\n\n- Note that an underlying HTTP client library must be specified, it is not\n  built-in. The API for requests/responses is equivalent to a simple subset \n  of [superagent's][superagent]. So superagent is the easiest choice, but not\n  the only one.\n\n- The Correlation object is implemented in [json-schema-core][core], and \n  extended in [json-schema-hyper][hyper], qq.v. for more examples of usage.\n\n- During dereferencing, missing fragment and external URI references yield \n  errors.\n\n- Missing schemas referenced (via HTTP headers) in instance data yield\n  errors. However, if there are multiple indicated schemas, any that are\n  not missing _will_ be correlated to the instance data, _in addition to_\n  yielding errors for the missing ones. (This behavior may change.)\n\n- Cyclical references (i.e., schema A references schema B which references \n  schema C, which in turn references schema A), are detected and yield an\n  error.\n\n\n## Limitations\n\n\n- Both Content-Type and Link header -style correlation methods are supported\n(see [Core, sec. 8][speccore8]). However, specification of the _root relation_ \nvia the Link header (see [Hyper-Schema, sec. 4.2][spechyper4-2]), is not \ncurrently supported. This may be implemented in the future.\n\n- This library provides parsing of the `media` property within schemas, \nhowever the internal representation of media type values (i.e., the use of this\ninformation in parsing the values) is left for the upstream application.\n\n- The `readOnly` property within Link Description Object (LDO) schemas is\nnot currently validated during write operations (POST/PUT/PATCH). It is not\nclear from [the spec][spechyper4-4] whether it is the responsibility of the \nclient to do so.\n\n- The `pathStart` schema property is not currently validated when correlating\ninstances ([Hyper-Schema, sec. 4.5][spechyper4-5]). This may be implemented in \nthe future.\n\n- Likewise, the determination of _authoritative_ representation of the `self`\nlink target is not currently implemented \n([Hyper-Schema, sec. 5.2.2][spechyper5-2-2]), but may be in the future.\n\n\n## License\n\n  MIT\n\n\n[spechyper]: http://tools.ietf.org/html/draft-luff-json-hyper-schema-00\n[spechyper4-2]: http://tools.ietf.org/html/draft-luff-json-hyper-schema-00#section-4.2\n[spechyper4-4]: http://tools.ietf.org/html/draft-luff-json-hyper-schema-00#section-4.4\n[spechyper4-5]: http://tools.ietf.org/html/draft-luff-json-hyper-schema-00#section-4.5\n[spechyper5-2-2]: http://tools.ietf.org/html/draft-luff-json-hyper-schema-00#section-5.2.2\n[speccore]: http://tools.ietf.org/html/draft-zyp-json-schema-04\n[speccore8]: http://tools.ietf.org/html/draft-zyp-json-schema-04#section-8.1\n[core]: https://github.com/ericgj/json-schema-core\n[hyper]: https://github.com/ericgj/json-schema-hyper\n[valid]: https://github.com/ericgj/json-schema-valid\n[superagent]: https://github.com/visionmedia/superagent\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Fjson-schema-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericgj%2Fjson-schema-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Fjson-schema-agent/lists"}