Gathering detailed insights and metrics for @apidevtools/json-schema-ref-parser
Gathering detailed insights and metrics for @apidevtools/json-schema-ref-parser
Gathering detailed insights and metrics for @apidevtools/json-schema-ref-parser
Gathering detailed insights and metrics for @apidevtools/json-schema-ref-parser
uui-json-schema-ref-parser
Forked from https://github.com/APIDevTools/json-schema-ref-parser
trellis-core
The Trellis core library supports the `trellis-cli` and `trellis-ui` projects by wrapping the [handlebars](https://handlebarsjs.com) and [JSON Schema $Ref Parser](https://github.com/APIDevTools/json-schema-ref-parser) projects to extend and abstract for u
node-apifactory
Web framework for API-first development via OpenAPI specification with included validation according to OpenAPI based on fastify and @apidevtools/json-schema-ref-parser.
Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
npm install @apidevtools/json-schema-ref-parser
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.1
Supply Chain
100
Quality
95.7
Maintenance
100
Vulnerability
99.6
License
TypeScript (99.64%)
JavaScript (0.32%)
HTML (0.03%)
CSS (0.01%)
Total Downloads
521,623,552
Last Day
268,389
Last Week
5,221,277
Last Month
22,330,164
Last Year
211,703,542
MIT License
1,035 Stars
745 Commits
236 Forks
8 Watchers
14 Branches
51 Contributors
Updated on Jul 07, 2025
Minified
Minified + Gzipped
Latest Version
14.1.0
Package Id
@apidevtools/json-schema-ref-parser@14.1.0
Unpacked Size
336.76 kB
Size
70.36 kB
File Count
75
NPM Version
10.9.3
Node Version
22.16.0
Published on
Jul 07, 2025
Cumulative downloads
Total Downloads
Last Day
5.3%
268,389
Compared to previous day
Last Week
-5.9%
5,221,277
Compared to previous week
Last Month
2.8%
22,330,164
Compared to previous month
Last Year
55.4%
211,703,542
Compared to previous year
2
23
Install using npm:
1npm install @apidevtools/json-schema-ref-parser 2yarn add @apidevtools/json-schema-ref-parser 3bun add @apidevtools/json-schema-ref-parser
You've got a JSON Schema with $ref
pointers to other files and/or URLs. Maybe you know all the referenced files ahead
of time. Maybe you don't. Maybe some are local files, and others are remote URLs. Maybe they are a mix of JSON and YAML
format. Maybe some of the files contain cross-references to each other.
1{ 2 "definitions": { 3 "person": { 4 // references an external file 5 "$ref": "schemas/people/Bruce-Wayne.json" 6 }, 7 "place": { 8 // references a sub-schema in an external file 9 "$ref": "schemas/places.yaml#/definitions/Gotham-City" 10 }, 11 "thing": { 12 // references a URL 13 "$ref": "http://wayne-enterprises.com/things/batmobile" 14 }, 15 "color": { 16 // references a value in an external file via an internal reference 17 "$ref": "#/definitions/thing/properties/colors/black-as-the-night" 18 } 19 } 20}
JSON Schema $Ref Parser is a full JSON Reference and JSON Pointer implementation that crawls even the most complex JSON Schemas and gives you simple, straightforward JavaScript objects.
$ref
pointers to external files and URLs, as well
as custom sources such as databases$ref
pointers$ref
pointers to the same value always resolve to the same object
instance1import $RefParser from "@apidevtools/json-schema-ref-parser"; 2 3try { 4 await $RefParser.dereference(mySchema); 5 // note - by default, mySchema is modified in place, and the returned value is a reference to the same object 6 console.log(mySchema.definitions.person.properties.firstName); 7 8 // if you want to avoid modifying the original schema, you can disable the `mutateInputSchema` option 9 let clonedSchema = await $RefParser.dereference(mySchema, { mutateInputSchema: false }); 10 console.log(clonedSchema.definitions.person.properties.firstName); 11} catch (err) { 12 console.error(err); 13}
For more detailed examples, please see the API Documentation
If you are using Node.js < 18, you'll need a polyfill for fetch
,
like node-fetch:
1import fetch from "node-fetch"; 2 3globalThis.fetch = fetch;
JSON Schema $Ref Parser supports recent versions of every major web browser. Older browsers may require Babel and/or polyfills.
To use JSON Schema $Ref Parser in a browser, you'll need to use a bundling tool such
as Webpack, Rollup, Parcel,
or Browserify. Some bundlers may require a bit of configuration, such as
setting browser: true
in rollup-plugin-resolve.
Webpack 5 has dropped the default export of node core modules in favour of polyfills, you'll need to set them up
yourself ( after npm-installing them )
Edit your webpack.config.js
:
1config.resolve.fallback = { 2 path: require.resolve("path-browserify"), 3 fs: require.resolve("browserify-fs"), 4}; 5 6config.plugins.push( 7 new webpack.ProvidePlugin({ 8 Buffer: ["buffer", "Buffer"], 9 }), 10);
Full API documentation is available right here
I welcome any contributions, enhancements, and bug-fixes. Open an issue on GitHub and submit a pull request.
To build/test the project locally on your computer:
Clone this repo
git clone https://github.com/APIDevTools/json-schema-ref-parser.git
Install dependencies
yarn install
Run the tests
yarn test
JSON Schema $Ref Parser is 100% free and open-source, under the MIT license. Use it however you want.
Thanks to these awesome contributors for their major support of this open-source project.
8.1/10
Summary
json-schema-ref-parser Prototype Pollution issue
Affected Versions
>= 11.0.0, <= 11.1.0
Patched Versions
11.2.0
Reason
no dangerous workflow patterns detected
Reason
27 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 6/30 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More