Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8369d91
refactor: simplify the code to serve Hey API requirements
mrlubos Dec 23, 2024
ab68509
0.0.0
mrlubos Dec 25, 2024
c667923
0.0.1
mrlubos Dec 25, 2024
7a54120
Merge pull request #1 from hey-api/feat/download-resolve
mrlubos Dec 25, 2024
8f5531c
chore: update package.json
mrlubos Dec 25, 2024
c9f9b09
Merge pull request #2 from hey-api/chore/package-json
mrlubos Dec 25, 2024
25ba4b3
fix: do not use buffer type as generic
mrlubos Dec 25, 2024
1754059
0.0.2
mrlubos Dec 25, 2024
4743034
Merge pull request #3 from hey-api/fix/buffer-type
mrlubos Dec 25, 2024
b790294
fix: allow passing timeout value to sendRequest
mrlubos Feb 3, 2025
e5c19c0
0.0.3
mrlubos Feb 3, 2025
1a3f1c0
Merge pull request #4 from hey-api/fix/request-timeout
mrlubos Feb 3, 2025
f153d25
chore: sync package.json version with npm
mrlubos Feb 3, 2025
6860977
Merge pull request #5 from hey-api/chore/package-json-version
mrlubos Feb 3, 2025
6eb665e
fix: correctly resolve json input
mrlubos Mar 14, 2025
a92ca73
1.0.3
mrlubos Mar 14, 2025
92dbaac
Merge pull request #6 from hey-api/fix/resolve-json
mrlubos Mar 14, 2025
5e5ccf1
fix: allow passing fetch options to request
mrlubos Mar 31, 2025
dbde5d1
Merge pull request #7 from hey-api/fix/fetch-options
mrlubos Mar 31, 2025
f0a4310
fix: extended equality check
mrlubos Apr 23, 2025
9ba4565
Merge pull request #8 from hey-api/fix/extended-ref-equality
mrlubos Apr 23, 2025
9e09d3b
fix: parsing of schema resolved from URL when HTTP status is 200
mblumenstingl-n11 May 5, 2025
7b37bdf
Merge pull request #9 from mblumenstingl-n11/fix/parsing-of-schema-re…
mrlubos May 13, 2025
4e36205
fix: improve inventory check for pointers and add tests for multiple …
carson2222 Aug 27, 2025
f05ba07
Merge pull request #10 from hey-api/fix/improve-ref-pointer-inventory…
carson2222 Aug 27, 2025
50c6ee3
fix: inline internal JSON Pointer refs under #/paths/ for OpenAPI bun…
carson2222 Aug 29, 2025
5fb8e24
chore: add test case
carson2222 Aug 29, 2025
a549ba5
chore: code cleanup
carson2222 Sep 1, 2025
d6f8438
chore: code cleanup
carson2222 Sep 1, 2025
5a801bf
Merge pull request #11 from hey-api/fix/internal-json-pointer-bundling
carson2222 Sep 1, 2025
b3ba1d9
feat: enhance performance tracking in JSON reference bundling
max-scopp Sep 2, 2025
9eea073
chore: disable debug logging for bundling process
max-scopp Sep 2, 2025
9937043
fix: enhance bundling and dereferencing logic for external $ref
carson2222 Sep 2, 2025
d4ec386
Merge branch 'main' into fix--update-external-ref-handling
carson2222 Sep 2, 2025
cbf25e7
Merge commit 'refs/pull/12/head' of https://github.com/hey-api/json-s…
carson2222 Sep 3, 2025
0f7f409
Merge pull request #13 from hey-api/fix--update-external-ref-handling
carson2222 Sep 3, 2025
4674566
feat: implement bundling of multiple schemas with enhanced prefix han…
carson2222 Sep 8, 2025
46315f8
chore: enhance schema merging logic to prioritize OpenAPI and Swagger…
carson2222 Sep 8, 2025
e97ef5c
chore: update version to 1.2.0 in package.json
carson2222 Sep 10, 2025
f5f2c67
docs: update README to reflect package name change and new features i…
carson2222 Sep 10, 2025
e043602
Merge pull request #14 from hey-api/feat--multiple-input-support
carson2222 Sep 10, 2025
e58322a
fix: do not overwrite in circular self references
mrlubos Oct 22, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)
MIT License

Copyright (c) 2015 James Messinger
Copyright (c) Hey API

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 8 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

#### Parse, Resolve, and Dereference JSON Schema $ref pointers

[![Build Status](https://github.com/APIDevTools/json-schema-ref-parser/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/json-schema-ref-parser/actions)
[![Coverage Status](https://coveralls.io/repos/github/APIDevTools/json-schema-ref-parser/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/json-schema-ref-parser)
<!-- [![Build Status](https://github.com/APIDevTools/json-schema-ref-parser/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/json-schema-ref-parser/actions)
[![Coverage Status](https://coveralls.io/repos/github/APIDevTools/json-schema-ref-parser/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/json-schema-ref-parser) -->

[![npm](https://img.shields.io/npm/v/@apidevtools/json-schema-ref-parser.svg)](https://www.npmjs.com/package/@apidevtools/json-schema-ref-parser)
[![License](https://img.shields.io/npm/l/@apidevtools/json-schema-ref-parser.svg)](LICENSE)
[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/APIDevTools/json-schema-ref-parser)
<!-- [![npm](https://img.shields.io/npm/v/@apidevtools/json-schema-ref-parser.svg)](https://www.npmjs.com/package/@apidevtools/json-schema-ref-parser)
[![License](https://img.shields.io/npm/l/@apidevtools/json-schema-ref-parser.svg)](LICENSE) -->

## Installation

Expand Down Expand Up @@ -58,13 +57,10 @@ complex [JSON Schemas](http://json-schema.org/latest/json-schema-core.html) and
JavaScript objects.

- Use **JSON** or **YAML** schemas &mdash; or even a mix of both!
- Supports `$ref` pointers to external files and URLs, as well
as [custom sources](https://apitools.dev/json-schema-ref-parser/docs/plugins/resolvers.html) such as databases
- Can [bundle](https://apitools.dev/json-schema-ref-parser/docs/ref-parser.html#bundlepath-options-callback) multiple
files into a single schema that only has _internal_ `$ref` pointers
- Can [dereference](https://apitools.dev/json-schema-ref-parser/docs/ref-parser.html#dereferencepath-options-callback)
your schema, producing a plain-old JavaScript object that's easy to work with
- Supports [circular references](https://apitools.dev/json-schema-ref-parser/docs/#circular-refs), nested references,
- Supports `$ref` pointers to external files and URLs, as well as custom sources such as databases
- Can bundle multiple files into a single schema that only has _internal_ `$ref` pointers
- Can dereference your schema, producing a plain-old JavaScript object that's easy to work with
- Supports circular references, nested references,
back-references, and cross-references between files
- Maintains object reference equality &mdash; `$ref` pointers to the same value always resolve to the same object
instance
Expand All @@ -88,8 +84,6 @@ try {
}
```

For more detailed examples, please see the [API Documentation](https://apitools.dev/json-schema-ref-parser/docs/)

## Polyfills

If you are using Node.js < 18, you'll need a polyfill for `fetch`,
Expand Down Expand Up @@ -130,16 +124,6 @@ config.plugins.push(
);
```

## API Documentation

Full API documentation is available [right here](https://apitools.dev/json-schema-ref-parser/docs/)

## Contributing

I welcome any contributions, enhancements, and
bug-fixes. [Open an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub
and [submit a pull request](https://github.com/APIDevTools/json-schema-ref-parser/pulls).

#### Building/Testing

To build/test the project locally on your computer:
Expand All @@ -152,19 +136,3 @@ To build/test the project locally on your computer:

3. **Run the tests**<br>
`yarn test`

## License

JSON Schema $Ref Parser is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.

This package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a
tree**](https://plant.treeware.earth/APIDevTools/json-schema-ref-parser) to thank us for our work. By contributing to
the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

## Big Thanks To

Thanks to these awesome companies for their support of Open Source developers ❤

[![Stoplight](https://svgshare.com/i/TK5.svg)](https://stoplight.io/?utm_source=github&utm_medium=readme&utm_campaign=json_schema_ref_parser)
[![SauceLabs](https://jstools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)
[![Coveralls](https://jstools.dev/img/badges/coveralls.svg)](https://coveralls.io)
44 changes: 15 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
"name": "@hey-api/json-schema-ref-parser",
"version": "0.0.1",
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers",
"homepage": "https://heyapi.dev/",
"repository": {
"type": "git",
"url": "git+https://github.com/hey-api/json-schema-ref-parser.git"
},
"bugs": {
"url": "https://github.com/hey-api/json-schema-ref-parser/issues"
},
"license": "MIT",
"author": {
"email": "lubos@heyapi.dev",
"name": "Hey API",
"url": "https://heyapi.dev"
},
"funding": "https://github.com/sponsors/hey-api",
"keywords": [
"json",
"schema",
Expand All @@ -12,35 +27,6 @@
"dereference",
"resolve"
],
"author": {
"name": "James Messinger",
"url": "https://jamesmessinger.com"
},
"contributors": [
{
"name": "Boris Cherny",
"email": "boris@performancejs.com"
},
{
"name": "Phil Sturgeon",
"email": "phil@apisyouwonthate.com"
},
{
"name": "Jakub Rożek",
"email": "jakub@stoplight.io"
},
{
"name": "JonLuca DeCaro",
"email": "apis@jonlu.ca"
}
],
"homepage": "https://apitools.dev/json-schema-ref-parser/",
"repository": {
"type": "git",
"url": "https://github.com/APIDevTools/json-schema-ref-parser.git"
},
"license": "MIT",
"funding": "https://github.com/sponsors/philsturgeon",
"types": "dist/lib/index.d.ts",
"main": "dist/lib/index.js",
"browser": {
Expand Down