You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 13, 2023. It is now read-only.
* fix: support for windows file paths
BREAKING CHANGE: authority is now baseUri, and is expected to be passed into resolve as a string.
* test: add one to test relative path read count
* feat: update terminology to align to spec
Recursively resolves JSON pointers and remote authorities.
5
+
Dereference $ref values in JSON Schema, OpenAPI (Swagger), and any other objects with $ref values inside of them.
6
6
7
7
- View the changelog: [Releases](https://github.com/stoplightio/json-ref-resolver/releases)
8
8
9
9
### Features
10
10
11
-
-**Performant**: Hot paths are memoized, remote authorities are resolved concurrently, and the minimum surface area is crawled and resolved.
12
-
-**Caching**: Results from remote authorities are cached.
13
-
-**Immutable**: The original object is not changed, and structural sharing is used to only change relevant bits. [example test](src/__tests__/resolver.spec.ts#L139-L143)
14
-
-**Reference equality:** Pointers to the same location will resolve to the same object in memory. [example test](src/__tests__/resolver.spec.ts#L145)
15
-
-**Flexible:** Bring your own readers for `http://`, `file://`, `mongo://`, `custom://`... etc.
11
+
-**Performant**: Hot paths are memoized, remote URIs are resolved concurrently, and the minimum surface area is crawled and resolved.
12
+
-**Caching**: Results from remote URIs are cached.
13
+
-**Immutable**: The original object is not changed, and structural sharing is used to only change relevant bits. [example test](src/__tests__/resolver.spec.ts#L182)
14
+
-**Reference equality:** $refs to the same location will resolve to the same object in memory. [example test](src/__tests__/resolver.spec.ts#L329)
15
+
-**Flexible:** Bring your own resolvers for `http://`, `file://`, `mongo://`, `custom://`... etc.
16
+
-**Cross Platform:** Supports POSIX and Windows style file paths.
16
17
-**Reliable:** Well tested to handle all sorts of circular reference edge cases.
17
18
18
19
### Installation
@@ -61,7 +62,9 @@ const resolver = new Resolver(globalOpts);
In the above example, the user \$ref will resolve to `/models/user.json`, because `../models/user.json` is resolved against the authority of the current document (which was indicated at `/specs/api.json`). Relative references will not work if the source document has no authority set.
247
+
In the above example, the user \$ref will resolve to `/models/user.json`, because `../models/user.json` is resolved against the baseUri of the current document (which was indicated at `/specs/api.json`). Relative references will not work if the source document has no baseUri set.
0 commit comments