z-schema 6.0.2 → 7.0.0-beta.2

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.
Files changed (51) hide show
  1. package/README.md +154 -134
  2. package/bin/z-schema +128 -124
  3. package/cjs/ZSchema.d.ts +227 -0
  4. package/cjs/ZSchema.js +13785 -0
  5. package/dist/Errors.js +50 -0
  6. package/dist/FormatValidators.js +136 -0
  7. package/{src → dist}/JsonValidation.js +184 -213
  8. package/dist/Report.js +220 -0
  9. package/{src → dist}/SchemaCache.js +67 -82
  10. package/{src → dist}/SchemaCompilation.js +89 -129
  11. package/dist/SchemaValidation.js +631 -0
  12. package/{src → dist}/Utils.js +96 -104
  13. package/dist/ZSchema.js +365 -0
  14. package/dist/index.js +2 -0
  15. package/dist/schemas/hyper-schema.json +156 -0
  16. package/dist/schemas/schema.json +151 -0
  17. package/dist/types/Errors.d.ts +44 -0
  18. package/dist/types/FormatValidators.d.ts +12 -0
  19. package/dist/types/JsonValidation.d.ts +37 -0
  20. package/dist/types/Report.d.ts +87 -0
  21. package/dist/types/SchemaCache.d.ts +26 -0
  22. package/dist/types/SchemaCompilation.d.ts +1 -0
  23. package/dist/types/SchemaValidation.d.ts +6 -0
  24. package/dist/types/Utils.d.ts +64 -0
  25. package/dist/types/ZSchema.d.ts +97 -0
  26. package/dist/types/index.d.ts +2 -0
  27. package/package.json +59 -45
  28. package/src/Errors.ts +56 -0
  29. package/src/FormatValidators.ts +136 -0
  30. package/src/JsonValidation.ts +624 -0
  31. package/src/Report.ts +337 -0
  32. package/src/SchemaCache.ts +189 -0
  33. package/src/SchemaCompilation.ts +293 -0
  34. package/src/SchemaValidation.ts +629 -0
  35. package/src/Utils.ts +286 -0
  36. package/src/ZSchema.ts +467 -0
  37. package/src/index.ts +3 -0
  38. package/src/schemas/_ +0 -0
  39. package/umd/ZSchema.js +13791 -0
  40. package/umd/ZSchema.min.js +1 -0
  41. package/dist/ZSchema-browser-min.js +0 -2
  42. package/dist/ZSchema-browser-min.js.map +0 -1
  43. package/dist/ZSchema-browser-test.js +0 -32247
  44. package/dist/ZSchema-browser.js +0 -12745
  45. package/index.d.ts +0 -175
  46. package/src/Errors.js +0 -60
  47. package/src/FormatValidators.js +0 -129
  48. package/src/Polyfills.js +0 -16
  49. package/src/Report.js +0 -299
  50. package/src/SchemaValidation.js +0 -619
  51. package/src/ZSchema.js +0 -409
@@ -0,0 +1,365 @@
1
+ import get from 'lodash.get';
2
+ import { Report } from './Report.js';
3
+ import { FormatValidators } from './FormatValidators.js';
4
+ import * as JsonValidation from './JsonValidation.js';
5
+ import * as SchemaCache from './SchemaCache.js';
6
+ import * as SchemaCompilation from './SchemaCompilation.js';
7
+ import * as SchemaValidation from './SchemaValidation.js';
8
+ import * as Utils from './Utils.js';
9
+ import Draft4Schema from './schemas/schema.json' with { type: 'json' };
10
+ import Draft4HyperSchema from './schemas/hyper-schema.json' with { type: 'json' };
11
+ /**
12
+ * default options
13
+ */
14
+ const defaultOptions = {
15
+ // default timeout for all async tasks
16
+ asyncTimeout: 2000,
17
+ // force additionalProperties and additionalItems to be defined on "object" and "array" types
18
+ forceAdditional: false,
19
+ // assume additionalProperties and additionalItems are defined as "false" where appropriate
20
+ assumeAdditional: false,
21
+ // do case insensitive comparison for enums
22
+ enumCaseInsensitiveComparison: false,
23
+ // force items to be defined on "array" types
24
+ forceItems: false,
25
+ // force minItems to be defined on "array" types
26
+ forceMinItems: false,
27
+ // force maxItems to be defined on "array" types
28
+ forceMaxItems: false,
29
+ // force minLength to be defined on "string" types
30
+ forceMinLength: false,
31
+ // force maxLength to be defined on "string" types
32
+ forceMaxLength: false,
33
+ // force properties or patternProperties to be defined on "object" types
34
+ forceProperties: false,
35
+ // ignore references that cannot be resolved (remote schemas) // TODO: make sure this is only for remote schemas, not local ones
36
+ ignoreUnresolvableReferences: false,
37
+ // disallow usage of keywords that this validator can't handle
38
+ noExtraKeywords: false,
39
+ // disallow usage of schema's without "type" defined
40
+ noTypeless: false,
41
+ // disallow zero length strings in validated objects
42
+ noEmptyStrings: false,
43
+ // disallow zero length arrays in validated objects
44
+ noEmptyArrays: false,
45
+ // forces "uri" format to be in fully rfc3986 compliant
46
+ strictUris: false,
47
+ // turn on some of the above
48
+ strictMode: false,
49
+ // report error paths as an array of path segments to get to the offending node
50
+ reportPathAsArray: false,
51
+ // stop validation as soon as an error is found
52
+ breakOnFirstError: false,
53
+ // check if schema follows best practices and common sense
54
+ pedanticCheck: false,
55
+ // ignore unknown formats (do not report them as an error)
56
+ ignoreUnknownFormats: false,
57
+ // function to be called on every schema
58
+ customValidator: null,
59
+ };
60
+ function normalizeOptions(options) {
61
+ let normalized;
62
+ // options
63
+ if (typeof options === 'object') {
64
+ let keys = Object.keys(options), idx = keys.length, key;
65
+ // check that the options are correctly configured
66
+ while (idx--) {
67
+ key = keys[idx];
68
+ if (defaultOptions[key] === undefined) {
69
+ throw new Error('Unexpected option passed to constructor: ' + key);
70
+ }
71
+ }
72
+ // copy the default options into passed options
73
+ keys = Object.keys(defaultOptions);
74
+ idx = keys.length;
75
+ while (idx--) {
76
+ key = keys[idx];
77
+ if (options[key] === undefined) {
78
+ options[key] = Utils.clone(defaultOptions[key]);
79
+ }
80
+ }
81
+ normalized = options;
82
+ }
83
+ else {
84
+ normalized = Utils.clone(defaultOptions);
85
+ }
86
+ if (normalized.strictMode === true) {
87
+ normalized.forceAdditional = true;
88
+ normalized.forceItems = true;
89
+ normalized.forceMaxLength = true;
90
+ normalized.forceProperties = true;
91
+ normalized.noExtraKeywords = true;
92
+ normalized.noTypeless = true;
93
+ normalized.noEmptyStrings = true;
94
+ normalized.noEmptyArrays = true;
95
+ }
96
+ return normalized;
97
+ }
98
+ export class ZSchema {
99
+ lastReport;
100
+ /**
101
+ * Register a custom format.
102
+ *
103
+ * @param name - name of the custom format
104
+ * @param validatorFunction - custom format validator function.
105
+ * Returns `true` if `value` matches the custom format.
106
+ */
107
+ static registerFormat(formatName, validatorFunction) {
108
+ FormatValidators[formatName] = validatorFunction;
109
+ }
110
+ /**
111
+ * Unregister a format.
112
+ *
113
+ * @param name - name of the custom format
114
+ */
115
+ static unregisterFormat(name) {
116
+ delete FormatValidators[name];
117
+ }
118
+ /**
119
+ * Get the list of all registered formats.
120
+ *
121
+ * Both the names of the burned-in formats and the custom format names are
122
+ * returned by this function.
123
+ *
124
+ * @returns {string[]} the list of all registered format names.
125
+ */
126
+ static getRegisteredFormats() {
127
+ return Object.keys(FormatValidators);
128
+ }
129
+ static getDefaultOptions() {
130
+ return Utils.cloneDeep(defaultOptions);
131
+ }
132
+ cache;
133
+ referenceCache;
134
+ validateOptions;
135
+ options;
136
+ constructor(options) {
137
+ this.cache = {};
138
+ this.referenceCache = [];
139
+ this.validateOptions = {};
140
+ this.options = normalizeOptions(options);
141
+ // Disable strict validation for the built-in schemas
142
+ const metaschemaOptions = normalizeOptions({});
143
+ this.setRemoteReference('http://json-schema.org/draft-04/schema', Draft4Schema, metaschemaOptions);
144
+ this.setRemoteReference('http://json-schema.org/draft-04/hyper-schema', Draft4HyperSchema, metaschemaOptions);
145
+ }
146
+ /**
147
+ * @param schema - JSON object representing schema
148
+ * @returns {boolean} true if schema is valid.
149
+ */
150
+ validateSchema(schema) {
151
+ if (Array.isArray(schema) && schema.length === 0) {
152
+ throw new Error('.validateSchema was called with an empty array');
153
+ }
154
+ const report = new Report(this.options);
155
+ schema = SchemaCache.getSchema.call(this, report, schema);
156
+ const compiled = SchemaCompilation.compileSchema.call(this, report, schema);
157
+ if (compiled) {
158
+ SchemaValidation.validateSchema.call(this, report, schema);
159
+ }
160
+ this.lastReport = report;
161
+ return report.isValid();
162
+ }
163
+ validate(json, schema, options, callback) {
164
+ if (typeof options === 'function') {
165
+ callback = options;
166
+ options = {};
167
+ }
168
+ if (!options) {
169
+ options = {};
170
+ }
171
+ this.validateOptions = options;
172
+ const whatIs = Utils.whatIs(schema);
173
+ if (whatIs !== 'string' && whatIs !== 'object') {
174
+ const e = new Error('Invalid .validate call - schema must be a string or object but ' + whatIs + ' was passed!');
175
+ if (callback) {
176
+ setTimeout(function () {
177
+ callback(e, false);
178
+ }, 0);
179
+ return;
180
+ }
181
+ throw e;
182
+ }
183
+ let foundError = false;
184
+ const report = new Report(this.options);
185
+ report.json = json;
186
+ if (typeof schema === 'string') {
187
+ const schemaName = schema;
188
+ schema = SchemaCache.getSchema.call(this, report, schemaName);
189
+ if (!schema) {
190
+ throw new Error("Schema with id '" + schemaName + "' wasn't found in the validator cache!");
191
+ }
192
+ }
193
+ else {
194
+ schema = SchemaCache.getSchema.call(this, report, schema);
195
+ }
196
+ let compiled = false;
197
+ if (!foundError) {
198
+ compiled = SchemaCompilation.compileSchema.call(this, report, schema);
199
+ }
200
+ if (!compiled) {
201
+ this.lastReport = report;
202
+ foundError = true;
203
+ }
204
+ let validated = false;
205
+ if (!foundError) {
206
+ validated = SchemaValidation.validateSchema.call(this, report, schema);
207
+ }
208
+ if (!validated) {
209
+ this.lastReport = report;
210
+ foundError = true;
211
+ }
212
+ if (options.schemaPath) {
213
+ report.rootSchema = schema;
214
+ schema = get(schema, options.schemaPath);
215
+ if (!schema) {
216
+ throw new Error("Schema path '" + options.schemaPath + "' wasn't found in the schema!");
217
+ }
218
+ }
219
+ if (!foundError) {
220
+ JsonValidation.validate.call(this, report, schema, json);
221
+ }
222
+ if (callback) {
223
+ report.processAsyncTasks(this.options.asyncTimeout, callback);
224
+ return;
225
+ }
226
+ else if (report.asyncTasks.length > 0) {
227
+ throw new Error('This validation has async tasks and cannot be done in sync mode, please provide callback argument.');
228
+ }
229
+ // assign lastReport so errors are retrievable in sync mode
230
+ this.lastReport = report;
231
+ return report.isValid();
232
+ }
233
+ /**
234
+ * Returns an Error object for the most recent failed validation, or null if the validation was successful.
235
+ */
236
+ getLastError() {
237
+ if (this.lastReport.errors.length === 0) {
238
+ return null;
239
+ }
240
+ const e = new Error();
241
+ e.name = 'z-schema validation error';
242
+ e.message = this.lastReport.commonErrorMessage;
243
+ e.details = this.lastReport.errors;
244
+ return e;
245
+ }
246
+ /**
247
+ * Returns the error details for the most recent validation, or undefined if the validation was successful.
248
+ * This is the same list as the SchemaError.details property.
249
+ */
250
+ getLastErrors() {
251
+ return this.lastReport && this.lastReport.errors.length > 0 ? this.lastReport.errors : null;
252
+ }
253
+ setRemoteReference(uri, schema, validationOptions) {
254
+ if (typeof schema === 'string') {
255
+ schema = JSON.parse(schema);
256
+ }
257
+ else {
258
+ schema = Utils.cloneDeep(schema);
259
+ }
260
+ if (validationOptions) {
261
+ schema.__$validationOptions = normalizeOptions(validationOptions);
262
+ }
263
+ SchemaCache.cacheSchemaByUri.call(this, uri, schema);
264
+ }
265
+ compileSchema(schema) {
266
+ const report = new Report(this.options);
267
+ schema = SchemaCache.getSchema.call(this, report, schema);
268
+ SchemaCompilation.compileSchema.call(this, report, schema);
269
+ this.lastReport = report;
270
+ return report.isValid();
271
+ }
272
+ getMissingReferences(arr) {
273
+ arr = arr || this.lastReport.errors;
274
+ let res = [], idx = arr.length;
275
+ while (idx--) {
276
+ const error = arr[idx];
277
+ if (error.code === 'UNRESOLVABLE_REFERENCE') {
278
+ const reference = error.params[0];
279
+ if (res.indexOf(reference) === -1) {
280
+ res.push(reference);
281
+ }
282
+ }
283
+ if (error.inner) {
284
+ res = res.concat(this.getMissingReferences(error.inner));
285
+ }
286
+ }
287
+ return res;
288
+ }
289
+ getMissingRemoteReferences() {
290
+ const missingReferences = this.getMissingReferences();
291
+ const missingRemoteReferences = [];
292
+ let idx = missingReferences.length;
293
+ while (idx--) {
294
+ const remoteReference = SchemaCache.getRemotePath(missingReferences[idx]);
295
+ if (remoteReference && missingRemoteReferences.indexOf(remoteReference) === -1) {
296
+ missingRemoteReferences.push(remoteReference);
297
+ }
298
+ }
299
+ return missingRemoteReferences;
300
+ }
301
+ getResolvedSchema(schema) {
302
+ const report = new Report(this.options);
303
+ schema = SchemaCache.getSchema.call(this, report, schema);
304
+ // clone before making any modifications
305
+ schema = Utils.cloneDeep(schema);
306
+ const visited = [];
307
+ // clean-up the schema and resolve references
308
+ const cleanup = function (schema) {
309
+ let key;
310
+ const typeOf = Utils.whatIs(schema);
311
+ if (typeOf !== 'object' && typeOf !== 'array') {
312
+ return;
313
+ }
314
+ if (schema.___$visited) {
315
+ return;
316
+ }
317
+ schema.___$visited = true;
318
+ visited.push(schema);
319
+ if (schema.$ref && schema.__$refResolved) {
320
+ const from = schema.__$refResolved;
321
+ const to = schema;
322
+ delete schema.$ref;
323
+ delete schema.__$refResolved;
324
+ for (key in from) {
325
+ if (Object.prototype.hasOwnProperty.call(from, key)) {
326
+ to[key] = from[key];
327
+ }
328
+ }
329
+ }
330
+ for (key in schema) {
331
+ if (Object.prototype.hasOwnProperty.call(schema, key)) {
332
+ if (key.indexOf('__$') === 0) {
333
+ delete schema[key];
334
+ }
335
+ else {
336
+ cleanup(schema[key]);
337
+ }
338
+ }
339
+ }
340
+ };
341
+ cleanup(schema);
342
+ visited.forEach(function (s) {
343
+ delete s.___$visited;
344
+ });
345
+ this.lastReport = report;
346
+ if (report.isValid()) {
347
+ return schema;
348
+ }
349
+ else {
350
+ throw this.getLastError();
351
+ }
352
+ }
353
+ static schemaReader;
354
+ setSchemaReader(schemaReader) {
355
+ return ZSchema.setSchemaReader(schemaReader);
356
+ }
357
+ getSchemaReader() {
358
+ return ZSchema.schemaReader;
359
+ }
360
+ static setSchemaReader(schemaReader) {
361
+ ZSchema.schemaReader = schemaReader;
362
+ }
363
+ static schemaSymbol = Utils.schemaSymbol;
364
+ static jsonSymbol = Utils.jsonSymbol;
365
+ }
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { ZSchema } from './ZSchema.js';
2
+ export default ZSchema;
@@ -0,0 +1,156 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/hyper-schema#",
3
+ "id": "http://json-schema.org/draft-04/hyper-schema#",
4
+ "title": "JSON Hyper-Schema",
5
+ "allOf": [
6
+ {
7
+ "$ref": "http://json-schema.org/draft-04/schema#"
8
+ }
9
+ ],
10
+ "properties": {
11
+ "additionalItems": {
12
+ "anyOf": [
13
+ {
14
+ "type": "boolean"
15
+ },
16
+ {
17
+ "$ref": "#"
18
+ }
19
+ ]
20
+ },
21
+ "additionalProperties": {
22
+ "anyOf": [
23
+ {
24
+ "type": "boolean"
25
+ },
26
+ {
27
+ "$ref": "#"
28
+ }
29
+ ]
30
+ },
31
+ "dependencies": {
32
+ "additionalProperties": {
33
+ "anyOf": [
34
+ {
35
+ "$ref": "#"
36
+ },
37
+ {
38
+ "type": "array"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ "items": {
44
+ "anyOf": [
45
+ {
46
+ "$ref": "#"
47
+ },
48
+ {
49
+ "$ref": "#/definitions/schemaArray"
50
+ }
51
+ ]
52
+ },
53
+ "definitions": {
54
+ "additionalProperties": {
55
+ "$ref": "#"
56
+ }
57
+ },
58
+ "patternProperties": {
59
+ "additionalProperties": {
60
+ "$ref": "#"
61
+ }
62
+ },
63
+ "properties": {
64
+ "additionalProperties": {
65
+ "$ref": "#"
66
+ }
67
+ },
68
+ "allOf": {
69
+ "$ref": "#/definitions/schemaArray"
70
+ },
71
+ "anyOf": {
72
+ "$ref": "#/definitions/schemaArray"
73
+ },
74
+ "oneOf": {
75
+ "$ref": "#/definitions/schemaArray"
76
+ },
77
+ "not": {
78
+ "$ref": "#"
79
+ },
80
+ "links": {
81
+ "type": "array",
82
+ "items": {
83
+ "$ref": "#/definitions/linkDescription"
84
+ }
85
+ },
86
+ "fragmentResolution": {
87
+ "type": "string"
88
+ },
89
+ "media": {
90
+ "type": "object",
91
+ "properties": {
92
+ "type": {
93
+ "description": "A media type, as described in RFC 2046",
94
+ "type": "string"
95
+ },
96
+ "binaryEncoding": {
97
+ "description": "A content encoding scheme, as described in RFC 2045",
98
+ "type": "string"
99
+ }
100
+ }
101
+ },
102
+ "pathStart": {
103
+ "description": "Instances' URIs must start with this value for this schema to apply to them",
104
+ "type": "string",
105
+ "format": "uri"
106
+ }
107
+ },
108
+ "definitions": {
109
+ "schemaArray": {
110
+ "type": "array",
111
+ "items": {
112
+ "$ref": "#"
113
+ }
114
+ },
115
+ "linkDescription": {
116
+ "title": "Link Description Object",
117
+ "type": "object",
118
+ "required": ["href", "rel"],
119
+ "properties": {
120
+ "href": {
121
+ "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
122
+ "type": "string"
123
+ },
124
+ "rel": {
125
+ "description": "relation to the target resource of the link",
126
+ "type": "string"
127
+ },
128
+ "title": {
129
+ "description": "a title for the link",
130
+ "type": "string"
131
+ },
132
+ "targetSchema": {
133
+ "description": "JSON Schema describing the link target",
134
+ "$ref": "#"
135
+ },
136
+ "mediaType": {
137
+ "description": "media type (as defined by RFC 2046) describing the link target",
138
+ "type": "string"
139
+ },
140
+ "method": {
141
+ "description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")",
142
+ "type": "string"
143
+ },
144
+ "encType": {
145
+ "description": "The media type in which to submit data along with the request",
146
+ "type": "string",
147
+ "default": "application/json"
148
+ },
149
+ "schema": {
150
+ "description": "Schema describing the data to submit along with the request",
151
+ "$ref": "#"
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
@@ -0,0 +1,151 @@
1
+ {
2
+ "id": "http://json-schema.org/draft-04/schema#",
3
+ "$schema": "http://json-schema.org/draft-04/schema#",
4
+ "description": "Core schema meta-schema",
5
+ "definitions": {
6
+ "schemaArray": {
7
+ "type": "array",
8
+ "minItems": 1,
9
+ "items": { "$ref": "#" }
10
+ },
11
+ "positiveInteger": {
12
+ "type": "integer",
13
+ "minimum": 0
14
+ },
15
+ "positiveIntegerDefault0": {
16
+ "allOf": [{ "$ref": "#/definitions/positiveInteger" }, { "default": 0 }]
17
+ },
18
+ "simpleTypes": {
19
+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
20
+ },
21
+ "stringArray": {
22
+ "type": "array",
23
+ "items": { "type": "string" },
24
+ "minItems": 1,
25
+ "uniqueItems": true
26
+ }
27
+ },
28
+ "type": "object",
29
+ "properties": {
30
+ "id": {
31
+ "type": "string",
32
+ "format": "uri"
33
+ },
34
+ "$schema": {
35
+ "type": "string",
36
+ "format": "uri"
37
+ },
38
+ "title": {
39
+ "type": "string"
40
+ },
41
+ "description": {
42
+ "type": "string"
43
+ },
44
+ "default": {},
45
+ "multipleOf": {
46
+ "type": "number",
47
+ "minimum": 0,
48
+ "exclusiveMinimum": true
49
+ },
50
+ "maximum": {
51
+ "type": "number"
52
+ },
53
+ "exclusiveMaximum": {
54
+ "type": "boolean",
55
+ "default": false
56
+ },
57
+ "minimum": {
58
+ "type": "number"
59
+ },
60
+ "exclusiveMinimum": {
61
+ "type": "boolean",
62
+ "default": false
63
+ },
64
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
65
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
66
+ "pattern": {
67
+ "type": "string",
68
+ "format": "regex"
69
+ },
70
+ "additionalItems": {
71
+ "anyOf": [
72
+ { "type": "boolean" },
73
+ { "$ref": "#" }
74
+ ],
75
+ "default": {}
76
+ },
77
+ "items": {
78
+ "anyOf": [
79
+ { "$ref": "#" },
80
+ { "$ref": "#/definitions/schemaArray" }
81
+ ],
82
+ "default": {}
83
+ },
84
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
85
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
86
+ "uniqueItems": {
87
+ "type": "boolean",
88
+ "default": false
89
+ },
90
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
91
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
92
+ "required": { "$ref": "#/definitions/stringArray" },
93
+ "additionalProperties": {
94
+ "anyOf": [
95
+ { "type": "boolean" },
96
+ { "$ref": "#" }
97
+ ],
98
+ "default": {}
99
+ },
100
+ "definitions": {
101
+ "type": "object",
102
+ "additionalProperties": { "$ref": "#" },
103
+ "default": {}
104
+ },
105
+ "properties": {
106
+ "type": "object",
107
+ "additionalProperties": { "$ref": "#" },
108
+ "default": {}
109
+ },
110
+ "patternProperties": {
111
+ "type": "object",
112
+ "additionalProperties": { "$ref": "#" },
113
+ "default": {}
114
+ },
115
+ "dependencies": {
116
+ "type": "object",
117
+ "additionalProperties": {
118
+ "anyOf": [
119
+ { "$ref": "#" },
120
+ { "$ref": "#/definitions/stringArray" }
121
+ ]
122
+ }
123
+ },
124
+ "enum": {
125
+ "type": "array",
126
+ "minItems": 1,
127
+ "uniqueItems": true
128
+ },
129
+ "type": {
130
+ "anyOf": [
131
+ { "$ref": "#/definitions/simpleTypes" },
132
+ {
133
+ "type": "array",
134
+ "items": { "$ref": "#/definitions/simpleTypes" },
135
+ "minItems": 1,
136
+ "uniqueItems": true
137
+ }
138
+ ]
139
+ },
140
+ "format": { "type": "string" },
141
+ "allOf": { "$ref": "#/definitions/schemaArray" },
142
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
143
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
144
+ "not": { "$ref": "#" }
145
+ },
146
+ "dependencies": {
147
+ "exclusiveMaximum": ["maximum"],
148
+ "exclusiveMinimum": ["minimum"]
149
+ },
150
+ "default": {}
151
+ }