Skip to content

Commit fbf910f

Browse files
Fixed broken links in the docs
1 parent 83a1cf8 commit fbf910f

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ $RefParser.dereference(mySchema)
8686
});
8787
```
8888

89-
For more detailed examples, please see the [api documentation](docs/README.md)
89+
For more detailed examples, please see the [API Documentation](docs/README.md)
9090

9191

9292
Installation

docs/README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
JSON Schema $Ref Parser API
22
==========================
33

4-
### [`$RefParser`](ref-parser.md)
4+
Things to Know
5+
---------------------
6+
- [Class methods vs. Instance methods](#class-methods-vs-instance-methods)
7+
- [Callbacks vs. Promises](#callbacks-vs-promises)
8+
- [Circular references](#circular-refs)
9+
10+
11+
Classes & Methods
12+
---------------------
13+
14+
#### [`$RefParser`](ref-parser.md)
515
- [`schema`](ref-parser.md#schema)
616
- [`$refs`](ref-parser.md#refs)
7-
- [`dereference()`](ref-parser.md#dereferencepath-options-callback)
8-
- [`bundle()`](ref-parser.md#bundlepath-options-callback)
9-
- [`parse()`](ref-parser.md#parsepath-options-callback)
10-
- [`resolve()`](ref-parser.md#resolvepath-options-callback)
17+
- [`dereference()`](ref-parser.md#dereferenceschema-options-callback)
18+
- [`bundle()`](ref-parser.md#bundleschema-options-callback)
19+
- [`parse()`](ref-parser.md#parseschema-options-callback)
20+
- [`resolve()`](ref-parser.md#resolveschema-options-callback)
1121

12-
### [`$Refs`](refs.md)
22+
#### [`$Refs`](refs.md)
1323
- [`circular`](refs.md#circular)
1424
- [`paths()`](refs.md#pathstypes)
1525
- [`values()`](refs.md#valuestypes)
@@ -19,18 +29,11 @@ JSON Schema $Ref Parser API
1929
- [`get()`](refs.md#getref-options)
2030
- [`set()`](refs.md#setref-value-options)
2131

22-
### [`YAML`](yaml.md)
32+
#### [`YAML`](yaml.md)
2333
- [`parse()`](yaml.md#parsetext)
2434
- [`stringify()`](yaml.md#stringifyvalue)
2535

26-
### [`Options`](options.md)
27-
28-
29-
Topics
30-
---------------------
31-
- [Class methods vs. Instance methods](#class-methods-vs-instance-methods)
32-
- [Callbacks vs. Promises](#callbacks-vs-promises)
33-
- [Circular references](#circular-refs)
36+
#### [`Options`](options.md)
3437

3538

3639
### Class methods vs. Instance methods
@@ -54,8 +57,7 @@ The difference is that in the second example you now have a reference to `parser
5457
Many people prefer [ES6 Promise syntax](http://javascriptplayground.com/blog/2015/02/promises/) instead of callbacks. JSON Schema $Ref Parser allows you to use whichever one you prefer. Every method accepts an optional callback _and_ returns a Promise. So pick your poison.
5558

5659

57-
Circular $Refs
58-
--------------------------
60+
### Circular $Refs
5961
JSON Schema files can contain [circular $ref pointers](https://gist.github.com/BigstickCarpet/d18278935fc73e3a0ee1), and JSON Schema $Ref Parser fully supports them. Circular references can be resolved and dereferenced just like any other reference. However, if you intend to serialize the dereferenced schema as JSON, then you should be aware that [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) does not support circular references by default, so you will need to [use a custom replacer function](https://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json).
6062

6163
You can disable circular references by setting the [`$refs.circular`](options.md) option to `false`. Then, if a circular reference is found, a `ReferenceError` will be thrown.

docs/ref-parser.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ This is the default export of JSON Schema $Ref Parser. You can creates instance
88
- [`$refs`](#refs)
99

1010
##### Methods
11-
- [`dereference()`](#dereferencepath-options-callback)
12-
- [`bundle()`](#bundlepath-options-callback)
13-
- [`parse()`](#parsepath-options-callback)
14-
- [`resolve()`](#resolvepath-options-callback)
11+
- [`dereference()`](#dereferenceschema-options-callback)
12+
- [`bundle()`](#bundleschema-options-callback)
13+
- [`parse()`](#parseschema-options-callback)
14+
- [`resolve()`](#resolveschema-options-callback)
1515

1616

1717
### `Schema`
@@ -65,7 +65,7 @@ See [Callbacks vs. Promises](README.md#callbacks-vs-promises)
6565

6666
Dereferences all `$ref` pointers in the JSON Schema, replacing each reference with its resolved value. This results in a schema object that does not contain _any_ `$ref` pointers. Instead, it's a normal JavaScript object tree that can easily be crawled and used just like any other JavaScript object. This is great for programmatic usage, especially when using tools that don't understand JSON references.
6767

68-
The `dereference` method maintains object reference equality, meaning that all `$ref` pointers that point to the same object will be replaced with references to the same object. Again, this is great for programmatic usage, but it does introduce the risk of [circular references](README.md#circular-refs), so be careful if you intend to serialize the schema using [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Consider using the [`bundle`](#bundlepath-options-callback) method instead, which does not create circular references.
68+
The `dereference` method maintains object reference equality, meaning that all `$ref` pointers that point to the same object will be replaced with references to the same object. Again, this is great for programmatic usage, but it does introduce the risk of [circular references](README.md#circular-refs), so be careful if you intend to serialize the schema using [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Consider using the [`bundle`](#bundleschema-options-callback) method instead, which does not create circular references.
6969

7070
```javascript
7171
$RefParser.dereference("my-schema.yaml")
@@ -94,7 +94,7 @@ A callback that will receive the bundled schema object
9494
- **Return Value:** `Promise`<br>
9595
See [Callbacks vs. Promises](README.md#callbacks-vs-promises)
9696

97-
Bundles all referenced files/URLs into a single schema that only has _internal_ `$ref` pointers. This lets you split-up your schema however you want while you're building it, but easily combine all those files together when it's time to package or distribute the schema to other people. The resulting schema size will be small, since it will still contain _internal_ JSON references rather than being [fully-dereferenced](#dereferencepath-options-callback).
97+
Bundles all referenced files/URLs into a single schema that only has _internal_ `$ref` pointers. This lets you split-up your schema however you want while you're building it, but easily combine all those files together when it's time to package or distribute the schema to other people. The resulting schema size will be small, since it will still contain _internal_ JSON references rather than being [fully-dereferenced](#dereferenceschema-options-callback).
9898

9999
This also eliminates the risk of [circular references](README.md#circular-refs), so the schema can be safely serialized using [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).
100100

@@ -122,7 +122,7 @@ A callback that will receive the parsed schema object, or an error
122122
- **Return Value:** `Promise`<br>
123123
See [Callbacks vs. Promises](README.md#callbacks-vs-promises)
124124

125-
> This method is used internally by other methods, such as [`bundle`](#bundlepath-options-callback) and [`dereference`](#dereferencepath-options-callback). You probably won't need to call this method yourself.
125+
> This method is used internally by other methods, such as [`bundle`](#bundleschema-options-callback) and [`dereference`](#dereferenceschema-options-callback). You probably won't need to call this method yourself.
126126
127127
Parses the given JSON Schema file (in JSON or YAML format), and returns it as a JavaScript object. This method **does not** resolve `$ref` pointers or dereference anything. It simply parses _one_ file and returns it.
128128

0 commit comments

Comments
 (0)