Skip to content

Commit 205b892

Browse files
authored
Fixed a far not all
1 parent 707e626 commit 205b892

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

docs/options.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
Options
22
==========================
33

4-
All [`$RefParser`](ref-parser.md) methods accept an optional `options` parameter, which you can use to customize how the JSON Schema is parsed, resolved, dereferenced, etc.
4+
All [`$RefParser`](ref-parser.md) methods accept an optional `options` parameter, which you could use for customizing the JSON Schema with parsed, resolved, dereferenced, etc.
55

66
If you pass an options parameter, you _don't_ need to specify _every_ option. Any options you don't specify will use their default values.
77

8-
Example
8+
The example
99
-------------------
1010

1111
```javascript
12-
$RefParser.dereference("my-schema.yaml", {
12+
$RefParser.dereference('my-schema.yaml', {
1313
parse: {
1414
json: false, // Disable the JSON parser
1515
yaml: {
1616
allowEmpty: false // Don't allow empty YAML files
1717
},
1818
text: {
19-
canParse: [".txt", ".html"], // Parse .txt and .html files as plain text (strings)
19+
canParse: ['.txt', '.html'], // Parse .txt and .html files as plain text (strings)
2020
encoding: 'utf16' // Use UTF-16 encoding
2121
}
2222
},
2323
resolve: {
2424
file: false, // Don't resolve local file references
2525
http: {
2626
timeout: 2000, // 2 second timeout
27-
withCredentials: true, // Include auth credentials when resolving HTTP references
27+
withCredentials: true // Include auth credentials when resolving HTTP references
2828
}
2929
},
3030
dereference: {
@@ -33,14 +33,13 @@ $RefParser.dereference("my-schema.yaml", {
3333
});
3434
```
3535

36-
37-
`parse` Options
36+
The `parse` option.
3837
-------------------
39-
The `parse` options determine how different types of files will be parsed.
38+
The `parse` option determines the way of parsing for a different file types.
4039

41-
JSON Schema $Ref Parser comes with built-in JSON, YAML, plain-text, and binary parsers, any of which you can configure or disable. You can also add [your own custom parsers](plugins/parsers.md) if you want.
40+
**The JSON Schema $Ref Parser** comes with built-in parsers for JSON, YAML, plain-text and binary files. You may configure and/or disable each of them. Also, you may add your own custom parsers following this [custom-parsers-manual](plugins/parsers.md).
4241

43-
|Option(s) |Type |Description
42+
| Option | Type | Description
4443
|:----------------------------|:----------|:------------
4544
|`json`<br>`yaml`<br>`text`<br>`binary`|`object` `boolean`|These are the built-in parsers. In addition, you can add [your own custom parsers](plugins/parsers.md)<br><br>To disable a parser, just set it to `false`.
4645
|`json.order` `yaml.order` `text.order` `binary.order`|`number`|Parsers run in a specific order, relative to other parsers. For example, a parser with `order: 5` will run _before_ a parser with `order: 10`. If a parser is unable to successfully parse a file, then the next parser is tried, until one succeeds or they all fail.<br><br>You can change the order in which parsers run, which is useful if you know that most of your referenced files will be a certain type, or if you add [your own custom parser](plugins/parsers.md) that you want to run _first_.

0 commit comments

Comments
 (0)