@apidevtools/json-schema-ref-parser 11.9.0 → 11.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.d.ts +17 -17
- package/lib/index.ts +17 -17
- package/package.json +1 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -42,14 +42,14 @@ export declare class $RefParser<S extends object = JSONSchema, O extends ParserO
|
|
|
42
42
|
parse(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
43
43
|
parse(schema: S | string | unknown, options: O): Promise<S>;
|
|
44
44
|
parse(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
45
|
-
parse(
|
|
46
|
-
parse(
|
|
45
|
+
parse(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
46
|
+
parse(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
47
47
|
static parse<S extends object = JSONSchema>(schema: S | string | unknown): Promise<S>;
|
|
48
48
|
static parse<S extends object = JSONSchema>(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
49
49
|
static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O): Promise<S>;
|
|
50
50
|
static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
51
|
-
static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
52
|
-
static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
51
|
+
static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
52
|
+
static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
53
53
|
/**
|
|
54
54
|
* *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
|
|
55
55
|
*
|
|
@@ -65,8 +65,8 @@ export declare class $RefParser<S extends object = JSONSchema, O extends ParserO
|
|
|
65
65
|
resolve(schema: S | string | unknown, callback: $RefsCallback<S, O>): Promise<void>;
|
|
66
66
|
resolve(schema: S | string | unknown, options: O): Promise<$Refs<S, O>>;
|
|
67
67
|
resolve(schema: S | string | unknown, options: O, callback: $RefsCallback<S, O>): Promise<void>;
|
|
68
|
-
resolve(
|
|
69
|
-
resolve(
|
|
68
|
+
resolve(path: string, schema: S | string | unknown, options: O): Promise<$Refs<S, O>>;
|
|
69
|
+
resolve(path: string, schema: S | string | unknown, options: O, callback: $RefsCallback<S, O>): Promise<void>;
|
|
70
70
|
/**
|
|
71
71
|
* *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
|
|
72
72
|
*
|
|
@@ -82,8 +82,8 @@ export declare class $RefParser<S extends object = JSONSchema, O extends ParserO
|
|
|
82
82
|
static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, callback: $RefsCallback<S, O>): Promise<void>;
|
|
83
83
|
static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O): Promise<$Refs<S, O>>;
|
|
84
84
|
static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O, callback: $RefsCallback<S, O>): Promise<void>;
|
|
85
|
-
static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
86
|
-
static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
85
|
+
static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O): Promise<$Refs<S, O>>;
|
|
86
|
+
static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O, callback: $RefsCallback<S, O>): Promise<void>;
|
|
87
87
|
/**
|
|
88
88
|
* 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.
|
|
89
89
|
*
|
|
@@ -99,8 +99,8 @@ export declare class $RefParser<S extends object = JSONSchema, O extends ParserO
|
|
|
99
99
|
static bundle<S extends object = JSONSchema>(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
100
100
|
static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O): Promise<S>;
|
|
101
101
|
static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
102
|
-
static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
103
|
-
static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
102
|
+
static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
103
|
+
static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<S>;
|
|
104
104
|
/**
|
|
105
105
|
* 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.
|
|
106
106
|
*
|
|
@@ -116,8 +116,8 @@ export declare class $RefParser<S extends object = JSONSchema, O extends ParserO
|
|
|
116
116
|
bundle(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
117
117
|
bundle(schema: S | string | unknown, options: O): Promise<S>;
|
|
118
118
|
bundle(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
119
|
-
bundle(
|
|
120
|
-
bundle(
|
|
119
|
+
bundle(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
120
|
+
bundle(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
121
121
|
/**
|
|
122
122
|
* 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.
|
|
123
123
|
*
|
|
@@ -133,8 +133,8 @@ export declare class $RefParser<S extends object = JSONSchema, O extends ParserO
|
|
|
133
133
|
static dereference<S extends object = JSONSchema>(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
134
134
|
static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O): Promise<S>;
|
|
135
135
|
static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
136
|
-
static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
137
|
-
static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
136
|
+
static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
137
|
+
static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
138
138
|
/**
|
|
139
139
|
* 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.
|
|
140
140
|
*
|
|
@@ -142,15 +142,15 @@ export declare class $RefParser<S extends object = JSONSchema, O extends ParserO
|
|
|
142
142
|
*
|
|
143
143
|
* See https://apitools.dev/json-schema-ref-parser/docs/ref-parser.html#dereferenceschema-options-callback
|
|
144
144
|
*
|
|
145
|
-
* @param
|
|
145
|
+
* @param path
|
|
146
146
|
* @param schema A JSON Schema object, or the file path or URL of a JSON Schema file. See the `parse` method for more info.
|
|
147
147
|
* @param options (optional)
|
|
148
148
|
* @param callback (optional) A callback that will receive the dereferenced schema object
|
|
149
149
|
*/
|
|
150
|
-
dereference(
|
|
150
|
+
dereference(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
151
151
|
dereference(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
152
152
|
dereference(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
153
|
-
dereference(
|
|
153
|
+
dereference(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
154
154
|
dereference(schema: S | string | unknown, options: O): Promise<S>;
|
|
155
155
|
dereference(schema: S | string | unknown): Promise<S>;
|
|
156
156
|
}
|
package/lib/index.ts
CHANGED
|
@@ -70,8 +70,8 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
70
70
|
public parse(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
71
71
|
public parse(schema: S | string | unknown, options: O): Promise<S>;
|
|
72
72
|
public parse(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
73
|
-
public parse(
|
|
74
|
-
public parse(
|
|
73
|
+
public parse(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
74
|
+
public parse(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
75
75
|
async parse() {
|
|
76
76
|
const args = normalizeArgs<S, O>(arguments as any);
|
|
77
77
|
let promise;
|
|
@@ -159,12 +159,12 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
159
159
|
callback: SchemaCallback<S>,
|
|
160
160
|
): Promise<void>;
|
|
161
161
|
public static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
162
|
-
|
|
162
|
+
path: string,
|
|
163
163
|
schema: S | string | unknown,
|
|
164
164
|
options: O,
|
|
165
165
|
): Promise<S>;
|
|
166
166
|
public static parse<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
167
|
-
|
|
167
|
+
path: string,
|
|
168
168
|
schema: S | string | unknown,
|
|
169
169
|
options: O,
|
|
170
170
|
callback: SchemaCallback<S>,
|
|
@@ -191,9 +191,9 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
191
191
|
public resolve(schema: S | string | unknown, callback: $RefsCallback<S, O>): Promise<void>;
|
|
192
192
|
public resolve(schema: S | string | unknown, options: O): Promise<$Refs<S, O>>;
|
|
193
193
|
public resolve(schema: S | string | unknown, options: O, callback: $RefsCallback<S, O>): Promise<void>;
|
|
194
|
-
public resolve(
|
|
194
|
+
public resolve(path: string, schema: S | string | unknown, options: O): Promise<$Refs<S, O>>;
|
|
195
195
|
public resolve(
|
|
196
|
-
|
|
196
|
+
path: string,
|
|
197
197
|
schema: S | string | unknown,
|
|
198
198
|
options: O,
|
|
199
199
|
callback: $RefsCallback<S, O>,
|
|
@@ -239,12 +239,12 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
239
239
|
callback: $RefsCallback<S, O>,
|
|
240
240
|
): Promise<void>;
|
|
241
241
|
public static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
242
|
-
|
|
242
|
+
path: string,
|
|
243
243
|
schema: S | string | unknown,
|
|
244
244
|
options: O,
|
|
245
245
|
): Promise<$Refs<S, O>>;
|
|
246
246
|
public static resolve<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
247
|
-
|
|
247
|
+
path: string,
|
|
248
248
|
schema: S | string | unknown,
|
|
249
249
|
options: O,
|
|
250
250
|
callback: $RefsCallback<S, O>,
|
|
@@ -282,12 +282,12 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
282
282
|
callback: SchemaCallback<S>,
|
|
283
283
|
): Promise<void>;
|
|
284
284
|
public static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
285
|
-
|
|
285
|
+
path: string,
|
|
286
286
|
schema: S | string | unknown,
|
|
287
287
|
options: O,
|
|
288
288
|
): Promise<S>;
|
|
289
289
|
public static bundle<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
290
|
-
|
|
290
|
+
path: string,
|
|
291
291
|
schema: S | string | unknown,
|
|
292
292
|
options: O,
|
|
293
293
|
callback: SchemaCallback<S>,
|
|
@@ -314,8 +314,8 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
314
314
|
public bundle(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
315
315
|
public bundle(schema: S | string | unknown, options: O): Promise<S>;
|
|
316
316
|
public bundle(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
317
|
-
public bundle(
|
|
318
|
-
public bundle(
|
|
317
|
+
public bundle(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
318
|
+
public bundle(path: string, schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
319
319
|
async bundle() {
|
|
320
320
|
const args = normalizeArgs<S, O>(arguments);
|
|
321
321
|
try {
|
|
@@ -354,12 +354,12 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
354
354
|
callback: SchemaCallback<S>,
|
|
355
355
|
): Promise<void>;
|
|
356
356
|
public static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
357
|
-
|
|
357
|
+
path: string,
|
|
358
358
|
schema: S | string | unknown,
|
|
359
359
|
options: O,
|
|
360
360
|
): Promise<S>;
|
|
361
361
|
public static dereference<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(
|
|
362
|
-
|
|
362
|
+
path: string,
|
|
363
363
|
schema: S | string | unknown,
|
|
364
364
|
options: O,
|
|
365
365
|
callback: SchemaCallback<S>,
|
|
@@ -378,20 +378,20 @@ export class $RefParser<S extends object = JSONSchema, O extends ParserOptions<S
|
|
|
378
378
|
*
|
|
379
379
|
* See https://apitools.dev/json-schema-ref-parser/docs/ref-parser.html#dereferenceschema-options-callback
|
|
380
380
|
*
|
|
381
|
-
* @param
|
|
381
|
+
* @param path
|
|
382
382
|
* @param schema A JSON Schema object, or the file path or URL of a JSON Schema file. See the `parse` method for more info.
|
|
383
383
|
* @param options (optional)
|
|
384
384
|
* @param callback (optional) A callback that will receive the dereferenced schema object
|
|
385
385
|
*/
|
|
386
386
|
public dereference(
|
|
387
|
-
|
|
387
|
+
path: string,
|
|
388
388
|
schema: S | string | unknown,
|
|
389
389
|
options: O,
|
|
390
390
|
callback: SchemaCallback<S>,
|
|
391
391
|
): Promise<void>;
|
|
392
392
|
public dereference(schema: S | string | unknown, options: O, callback: SchemaCallback<S>): Promise<void>;
|
|
393
393
|
public dereference(schema: S | string | unknown, callback: SchemaCallback<S>): Promise<void>;
|
|
394
|
-
public dereference(
|
|
394
|
+
public dereference(path: string, schema: S | string | unknown, options: O): Promise<S>;
|
|
395
395
|
public dereference(schema: S | string | unknown, options: O): Promise<S>;
|
|
396
396
|
public dereference(schema: S | string | unknown): Promise<S>;
|
|
397
397
|
async dereference() {
|