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
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The Problem:
20
20
--------------------------
21
21
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.
22
22
23
-
```json
23
+
```javascript
24
24
{
25
25
"definitions": {
26
26
"person": {
@@ -132,13 +132,13 @@ The API
132
132
- Objects
133
133
-[`Schema`](#schema-object)
134
134
-[`$Refs`](#refs-object)
135
-
-[`$Refs.paths()`](#refs-pathstypes)
136
-
-[`$Refs.values()`](#refs-valuestypes)
137
-
-[`$Refs.isExpired()`](#refs-isexpiredref)
138
-
-[`$Refs.expire()`](#refs-expireref)
139
-
-[`$Refs.exists()`](#refs-existsref)
140
-
-[`$Refs.get()`](#refs-getref-options)
141
-
-[`$Refs.set()`](#refs-setref-value-options)
135
+
-[`$Refs.paths()`](#refspathstypes)
136
+
-[`$Refs.values()`](#refsvaluestypes)
137
+
-[`$Refs.isExpired()`](#refsisexpiredref)
138
+
-[`$Refs.expire()`](#refsexpireref)
139
+
-[`$Refs.exists()`](#refsexistsref)
140
+
-[`$Refs.get()`](#refsgetref-options)
141
+
-[`$Refs.set()`](#refssetref-value-options)
142
142
-[`Options`](#options)
143
143
-[Class methods vs. Instance methods](#class-methods-vs-instance-methods)
|`allow.yaml` |bool |true |Determines whether YAML files are supported<br> (note: all JSON files are also valid YAML files)
448
448
|`allow.empty` |bool |true |Determines whether it's ok for a `$ref` pointer to point to an empty file
449
449
|`allow.unknown` |bool |true |Determines whether it's ok for a `$ref` pointer to point to an unknown/unsupported file type (such as HTML, text, image, etc.). The default is to resolve unknown files as a [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer)
450
-
|`$refs.internal` |bool |true |Determines whether internal `$ref` pointers (such as `#/definitions/widget`) will be dereferenced when calling [`dereference()`](#dereferencepath-options-callback). Either way, you'll still be able to get the value using [`$refs.get()`](#refs-get)
450
+
|`$refs.internal` |bool |true |Determines whether internal `$ref` pointers (such as `#/definitions/widget`) will be dereferenced when calling [`dereference()`](#dereferencepath-options-callback). Either way, you'll still be able to get the value using [`$refs.get()`](#refsgetref-options)
451
451
|`$refs.external` |bool |true |Determines whether external `$ref` pointers get resolved/dereferenced. If `false`, then no files/URLs will be retrieved. Use this if you only want to allow single-file schemas.
452
452
|`cache.fs` |number |60 |<aname="caching"></a>The length of time (in seconds) to cache local files. The default is one minute. Setting to zero will cache forever.
453
453
|`cache.http` |number |300 |The length of time (in seconds) to cache HTTP URLs. The default is five minutes. Setting to zero will cache forever.
0 commit comments