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
* See https://github.com/APIDevTools/json-schema-ref-parser/blob/master/docs/ref-parser.md#schema
16
16
*/
17
-
schema: JSONSchema4|JSONSchema6
17
+
schema: $RefParser.JSONSchema
18
18
19
19
/**
20
20
* The $refs property is a `$Refs` object, which lets you access all of the externally-referenced files in the schema, as well as easily get and set specific values in the schema using JSON pointers.
@@ -36,9 +36,30 @@ declare class $RefParser {
36
36
* @param options (optional)
37
37
* @param callback (optional) A callback that will receive the dereferenced schema object
* 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.
48
+
*
49
+
* 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, so be careful if you intend to serialize the schema using `JSON.stringify()`. Consider using the bundle method instead, which does not create circular references.
50
+
*
51
+
* See https://github.com/APIDevTools/json-schema-ref-parser/blob/master/docs/ref-parser.md#dereferenceschema-options-callback
52
+
*
53
+
* @param schema A JSON Schema object, or the file path or URL of a JSON Schema file. See the `parse` method for more info.
54
+
* @param options (optional)
55
+
* @param callback (optional) A callback that will receive the dereferenced schema object
* 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.
@@ -51,11 +72,30 @@ declare class $RefParser {
51
72
* @param options (optional)
52
73
* @param callback (optional) A callback that will receive the bundled schema object
* 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.
84
+
*
85
+
* This also eliminates the risk of circular references, so the schema can be safely serialized using `JSON.stringify()`.
86
+
*
87
+
* See https://github.com/APIDevTools/json-schema-ref-parser/blob/master/docs/ref-parser.md#bundleschema-options-callback
88
+
*
89
+
* @param schema A JSON Schema object, or the file path or URL of a JSON Schema file. See the `parse` method for more info.
90
+
* @param options (optional)
91
+
* @param callback (optional) A callback that will receive the bundled schema object
* *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
120
+
*
121
+
* 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.
122
+
*
123
+
* See https://github.com/APIDevTools/json-schema-ref-parser/blob/master/docs/ref-parser.md#parseschema-options-callback
124
+
*
125
+
* @param schema A JSON Schema object, or the file path or URL of a JSON Schema file. The path can be absolute or relative. In Node, the path is relative to `process.cwd()`. In the browser, it's relative to the URL of the page.
126
+
* @param options (optional)
127
+
* @param callback (optional) A callback that will receive the parsed schema object, or an error
* *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
138
+
*
139
+
* Resolves all JSON references (`$ref` pointers) in the given JSON Schema file. If it references any other files/URLs, then they will be downloaded and resolved as well. This method **does not** dereference anything. It simply gives you a `$Refs` object, which is a map of all the resolved references and their values.
140
+
*
141
+
* See https://github.com/APIDevTools/json-schema-ref-parser/blob/master/docs/ref-parser.md#resolveschema-options-callback
142
+
*
143
+
* @param schema A JSON Schema object, or the file path or URL of a JSON Schema file. See the `parse` method for more info.
144
+
* @param options (optional)
145
+
* @param callback (optional) A callback that will receive a `$Refs` object
0 commit comments