@prantlf/jsonlint 12.0.0 → 13.0.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/CHANGELOG.md +407 -0
- package/README.md +9 -9
- package/lib/cli.js +6 -4
- package/lib/index.d.ts +10 -2
- package/lib/validator.js +45 -35
- package/package.json +11 -7
- package/web/ajv.min.js +7 -1
- package/web/ajv.min.js.map +1 -7
- package/web/jsonlint.html +23 -5
- package/web/validator.min.js +3 -3
- package/web/validator.min.js.map +3 -3
- package/lib/schema-drafts.js +0 -482
- package/web/ajv7.min.js +0 -8
- package/web/ajv7.min.js.map +0 -1
- package/web/schema-drafts.min.js +0 -2
- package/web/schema-drafts.min.js.map +0 -7
package/web/jsonlint.html
CHANGED
|
@@ -46,6 +46,12 @@
|
|
|
46
46
|
flex-basis: calc(50% - 1ex);
|
|
47
47
|
min-width: calc(42ex - 3ex);
|
|
48
48
|
}
|
|
49
|
+
#environment {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
.with-schema #environment {
|
|
53
|
+
display: inline-block;
|
|
54
|
+
}
|
|
49
55
|
#options > * {
|
|
50
56
|
display: flex;
|
|
51
57
|
flex-wrap: wrap;
|
|
@@ -83,14 +89,14 @@
|
|
|
83
89
|
</header>
|
|
84
90
|
<main>
|
|
85
91
|
<section>
|
|
86
|
-
<form aria-label="Source">
|
|
92
|
+
<form aria-label="Source" id="form">
|
|
87
93
|
<div id="source">
|
|
88
94
|
<div id="data-section">
|
|
89
95
|
<label for="data">Data:</label>
|
|
90
96
|
<textarea id="data" rows="10" cols="40"></textarea>
|
|
91
97
|
</div>
|
|
92
98
|
<div id="schema-section">
|
|
93
|
-
<label for="schema">Schema
|
|
99
|
+
<label for="schema">Schema:</label>
|
|
94
100
|
<textarea id="schema" rows="10" cols="40"></textarea>
|
|
95
101
|
</div>
|
|
96
102
|
</div>
|
|
@@ -167,6 +173,16 @@
|
|
|
167
173
|
<input type="checkbox" id="with-schema">
|
|
168
174
|
<label for="with-schema">Use JSON Schema</label>
|
|
169
175
|
</div>
|
|
176
|
+
<div>
|
|
177
|
+
<select id="environment" aria-label="JSON Schema Environment">
|
|
178
|
+
<option value="draft-04">JSON Schema draft 04</option>
|
|
179
|
+
<option value="draft-06">JSON Schema draft 06</option>
|
|
180
|
+
<option value="draft-07" selected>JSON Schema draft 07</option>
|
|
181
|
+
<option value="draft-2019-09">JSON Schema draft 2019-09</option>
|
|
182
|
+
<option value="draft-2020-12">JSON Schema draft 2020-12</option>
|
|
183
|
+
<option value="jtd">JSON Type Definition</option>
|
|
184
|
+
</select>
|
|
185
|
+
</div>
|
|
170
186
|
</div>
|
|
171
187
|
</div>
|
|
172
188
|
<button id="validate" type="button">Validate</button>
|
|
@@ -187,7 +203,6 @@
|
|
|
187
203
|
<script src="sorter.min.js" defer></script>
|
|
188
204
|
<script src="printer.min.js" defer></script>
|
|
189
205
|
<script src="ajv.min.js" defer></script>
|
|
190
|
-
<script src="schema-drafts.min.js" defer></script>
|
|
191
206
|
<script src="validator.min.js" defer></script>
|
|
192
207
|
<script defer>
|
|
193
208
|
window.onload = function () {
|
|
@@ -218,7 +233,7 @@
|
|
|
218
233
|
function toggleSchemaValidation () {
|
|
219
234
|
var className = document.getElementById('with-schema').checked
|
|
220
235
|
? 'with-schema' : ''
|
|
221
|
-
document.getElementById('
|
|
236
|
+
document.getElementById('form').className = className
|
|
222
237
|
}
|
|
223
238
|
|
|
224
239
|
function selectParsingExtension () {
|
|
@@ -286,7 +301,10 @@
|
|
|
286
301
|
function parseInput (source, parserOptions) {
|
|
287
302
|
if (document.getElementById('with-schema').checked) {
|
|
288
303
|
var schema = document.getElementById('schema').value
|
|
289
|
-
var validate = jsonlintValidator.compile(schema,
|
|
304
|
+
var validate = jsonlintValidator.compile(schema, {
|
|
305
|
+
environment: document.getElementById('environment').value,
|
|
306
|
+
...parserOptions
|
|
307
|
+
})
|
|
290
308
|
return validate(source, parserOptions)
|
|
291
309
|
}
|
|
292
310
|
return jsonlint.parse(source, parserOptions)
|
package/web/validator.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(f
|
|
2
|
-
`+
|
|
3
|
-
`+
|
|
1
|
+
(function(j,f){if(typeof exports=="object"&&typeof module<"u"){const c=require("./jsonlint"),l={Ajv04:"ajv-draft-04",Ajv07:"ajv",AjvJTD:"ajv/dist/jtd",Ajv2019:"ajv/dist/2019",Ajv2020:"ajv/dist/2020",Schema06:"ajv/dist/refs/json-schema-draft-06.json"},d=g=>{const h=require(l[g]);return!h.$schema&&h.default||h};f(exports,c,d)}else if(typeof define=="function"&&define.amd)define("jsonlint-validator",["exports","jsonlint","ajv"],function(c,l,d){f(c,l,h=>{const m=d[h];return!m.$schema&&m.default||m})});else{j=j||self;const c=l=>{const d=j.ajv[l];return!d.$schema&&d.default||d};f(j.jsonlintValidator={},j.jsonlint,c)}})(this,function(j,f,c){"use strict";function l(e,s,t,a){const n=t.find(function(r){return a===f.pathToPointer(r.path)});if(n){const r=n.location.start,o=r.offset,i=r.line,u=r.column,S=f.getErrorTexts(e.reason,s,o,i,u);return e.message=S.message,e.excerpt=S.excerpt,S.pointer&&(e.pointer=S.pointer,e.location={start:{column:u,line:i,offset:o}}),!0}}function d(e,s,t){const a=e.dataPath,n=e.schemaPath,r=(a||"/")+" "+e.message+"; see "+n,o={reason:r,dataPath:a,schemaPath:n};return l(o,s,t,a)||(o.message=r),o}function g(e,s,t,a){t||(t=JSON.stringify(s,void 0,2)),a||(a={}),Object.assign(a,{tokenLocations:!0,tokenPaths:!0});const n=f.tokenize(t,a),r=d(e[0],t,n),o=new SyntaxError(r.message);return Object.assign(o,r),o}function h(e){let s;if(!e||e==="json-schema-draft-06"||e==="draft-06"){const t=c("Ajv07");s=new t,s.addMetaSchema(c("Schema06"))}else if(e==="json-schema-draft-07"||e==="draft-07"){const t=c("Ajv07");s=new t}else if(e==="json-schema-draft-04"||e==="draft-04"){const t=c("Ajv04");s=new t}else if(e==="json-schema-draft-2019-09"||e==="draft-2019-09"){const t=c("Ajv2019");s=new t}else if(e==="json-schema-draft-2020-12"||e==="draft-2020-12"){const t=c("Ajv2020");s=new t}else if(e==="json-type-definition"||e==="jtd"||e==="rfc8927"){const t=c("AjvJTD");s=new t}else throw new RangeError('Unsupported environment for the JSON Schema validation: "'+e+'".');return s}function m(e,s,t){let a;try{a=f.parse(s,t)}catch(n){throw n.message=`Parsing the JSON Schema failed.
|
|
2
|
+
`+n.message,n}try{return e.compile(a)}catch(n){const r=e.errors,o=r?g(r,a,s,t):n;throw o.message=`Compiling the JSON Schema failed.
|
|
3
|
+
`+o.message,o}}function w(e,s){let t={};typeof s=="object"&&!(s instanceof String)&&(t=s,s=t.environment);const a=h(s),n={mode:t.mode,ignoreBOM:t.ignoreBOM,ignoreComments:t.ignoreComments,ignoreTrailingCommas:t.ignoreTrailingCommas,allowSingleQuotedStrings:t.allowSingleQuotedStrings,allowDuplicateObjectKeys:t.allowDuplicateObjectKeys},r=m(a,e,n);return function(o,i,u){if(typeof o=="string"||o instanceof String?(u=i,i=o,o=f.parse(i,u)):typeof i=="string"||i instanceof String||(u=i,i=void 0),r(o))return o;throw g(r.errors,o,i,u)}}j.compile=w,Object.defineProperty(j,"__esModule",{value:!0})});
|
|
4
4
|
//# sourceMappingURL=validator.min.js.map
|
package/web/validator.min.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/validator.js"],
|
|
4
|
-
"sourcesContent": ["(function (global, factory) {\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n const jsonlint = require('./jsonlint')\n const
|
|
5
|
-
"mappings": "CAAC,SAAUA,EAAQC,EAAS,CAC1B,GAAI,OAAO,SAAY,UAAY,OAAO,OAAW,IAAa,
|
|
6
|
-
"names": ["global", "factory", "
|
|
4
|
+
"sourcesContent": ["(function (global, factory) {\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n const jsonlint = require('./jsonlint')\n const ajv = {\n Ajv04: 'ajv-draft-04',\n Ajv07: 'ajv',\n AjvJTD: 'ajv/dist/jtd',\n Ajv2019: 'ajv/dist/2019',\n Ajv2020: 'ajv/dist/2020',\n Schema06: 'ajv/dist/refs/json-schema-draft-06.json'\n }\n const requireAjv = name => {\n const exported = require(ajv[name])\n return !exported.$schema && exported.default || exported\n }\n factory(exports, jsonlint, requireAjv)\n } else if (typeof define === 'function' && define.amd) {\n define('jsonlint-validator', ['exports', 'jsonlint', 'ajv'],\n function (exports, jsonlint, ajv) {\n const requireAjv = name => {\n const exported = ajv[name]\n return !exported.$schema && exported.default || exported\n }\n factory(exports, jsonlint, requireAjv)\n })\n } else {\n global = global || self\n const requireAjv = name => {\n const exported = global.ajv[name]\n return !exported.$schema && exported.default || exported\n }\n factory(global.jsonlintValidator = {}, global.jsonlint, requireAjv)\n }\n}(this, function (exports, jsonlint, requireAjv) {\n 'use strict'\n\n function addErrorLocation (problem, input, tokens, dataPath) {\n const token = tokens.find(function (token) {\n return dataPath === jsonlint.pathToPointer(token.path)\n })\n if (token) {\n const location = token.location.start\n const offset = location.offset\n const line = location.line\n const column = location.column\n const texts = jsonlint.getErrorTexts(problem.reason, input, offset, line, column)\n problem.message = texts.message\n problem.excerpt = texts.excerpt\n if (texts.pointer) {\n problem.pointer = texts.pointer\n problem.location = {\n start: {\n column,\n line,\n offset\n }\n }\n }\n return true\n }\n }\n\n function errorToProblem (error, input, tokens) {\n const dataPath = error.dataPath\n const schemaPath = error.schemaPath\n const reason = (dataPath || '/') + ' ' + error.message + '; see ' + schemaPath\n const problem = {\n reason,\n dataPath,\n schemaPath\n }\n if (!addErrorLocation(problem, input, tokens, dataPath)) {\n problem.message = reason\n }\n return problem\n }\n\n function createError (errors, data, input, options) {\n if (!input) {\n input = JSON.stringify(data, undefined, 2)\n }\n if (!options) {\n options = {}\n }\n Object.assign(options, {\n tokenLocations: true,\n tokenPaths: true\n })\n const tokens = jsonlint.tokenize(input, options)\n // var problems = errors.map(function (error) {\n // return errorToProblem(error, input, tokens)\n // })\n // var message = problems\n // .map(function (problem) {\n // return problem.message\n // })\n // .join('\\n')\n const problem = errorToProblem(errors[0], input, tokens)\n const error = new SyntaxError(problem.message)\n Object.assign(error, problem)\n return error\n }\n\n function createAjv (environment) {\n let ajv\n if (!environment || environment === 'json-schema-draft-06' || environment === 'draft-06') {\n const Ajv = requireAjv('Ajv07')\n ajv = new Ajv()\n ajv.addMetaSchema(requireAjv('Schema06'))\n } else if (environment === 'json-schema-draft-07' || environment === 'draft-07') {\n const Ajv = requireAjv('Ajv07')\n ajv = new Ajv()\n } else if (environment === 'json-schema-draft-04' || environment === 'draft-04') {\n const Ajv = requireAjv('Ajv04')\n ajv = new Ajv()\n } else if (environment === 'json-schema-draft-2019-09' || environment === 'draft-2019-09') {\n const Ajv = requireAjv('Ajv2019')\n ajv = new Ajv()\n } else if (environment === 'json-schema-draft-2020-12' || environment === 'draft-2020-12') {\n const Ajv = requireAjv('Ajv2020')\n ajv = new Ajv()\n } else if (environment === 'json-type-definition' || environment === 'jtd' || environment === 'rfc8927') {\n const Ajv = requireAjv('AjvJTD')\n ajv = new Ajv()\n } else {\n throw new RangeError('Unsupported environment for the JSON Schema validation: \"' +\n environment + '\".')\n }\n return ajv\n }\n\n function compileSchema (ajv, schema, parseOptions) {\n let parsed\n try {\n parsed = jsonlint.parse(schema, parseOptions)\n } catch (error) {\n error.message = 'Parsing the JSON Schema failed.\\n' + error.message\n throw error\n }\n try {\n return ajv.compile(parsed)\n } catch (originalError) {\n const errors = ajv.errors\n const betterError = errors\n ? createError(errors, parsed, schema, parseOptions)\n : originalError\n betterError.message = 'Compiling the JSON Schema failed.\\n' + betterError.message\n throw betterError\n }\n }\n\n function compile (schema, environment) {\n let options = {}\n if (typeof environment === 'object' && !(environment instanceof String)) {\n options = environment\n environment = options.environment\n }\n const ajv = createAjv(environment)\n const parseOptions = {\n mode: options.mode,\n ignoreBOM: options.ignoreBOM,\n ignoreComments: options.ignoreComments,\n ignoreTrailingCommas: options.ignoreTrailingCommas,\n allowSingleQuotedStrings: options.allowSingleQuotedStrings,\n allowDuplicateObjectKeys: options.allowDuplicateObjectKeys\n }\n const validate = compileSchema(ajv, schema, parseOptions)\n return function (data, input, options) {\n if (typeof data === 'string' || data instanceof String) {\n options = input\n input = data\n data = jsonlint.parse(input, options)\n } else if (!(typeof input === 'string' || input instanceof String)) {\n options = input\n input = undefined\n }\n if (validate(data)) {\n return data\n }\n throw createError(validate.errors, data, input, options)\n }\n }\n\n exports.compile = compile\n\n Object.defineProperty(exports, '__esModule', { value: true })\n}))\n"],
|
|
5
|
+
"mappings": "CAAC,SAAUA,EAAQC,EAAS,CAC1B,GAAI,OAAO,SAAY,UAAY,OAAO,OAAW,IAAa,CAChE,MAAMC,EAAW,QAAQ,YAAY,EAC/BC,EAAM,CACV,MAAO,eACP,MAAO,MACP,OAAQ,eACR,QAAS,gBACT,QAAS,gBACT,SAAU,yCACZ,EACMC,EAAaC,GAAQ,CACzB,MAAMC,EAAW,QAAQH,EAAIE,CAAI,CAAC,EAClC,MAAO,CAACC,EAAS,SAAWA,EAAS,SAAWA,CAClD,EACAL,EAAQ,QAASC,EAAUE,CAAU,UAC5B,OAAO,QAAW,YAAc,OAAO,IAChD,OAAO,qBAAsB,CAAC,UAAW,WAAY,KAAK,EACxD,SAAUG,EAASL,EAAUC,EAAK,CAKhCF,EAAQM,EAASL,EAJEG,GAAQ,CACzB,MAAMC,EAAWH,EAAIE,CAAI,EACzB,MAAO,CAACC,EAAS,SAAWA,EAAS,SAAWA,CAClD,CACqC,CACvC,CAAC,MACE,CACLN,EAASA,GAAU,KACnB,MAAMI,EAAaC,GAAQ,CACzB,MAAMC,EAAWN,EAAO,IAAIK,CAAI,EAChC,MAAO,CAACC,EAAS,SAAWA,EAAS,SAAWA,CAClD,EACAL,EAAQD,EAAO,kBAAoB,CAAC,EAAGA,EAAO,SAAUI,CAAU,EAEtE,GAAE,KAAM,SAAUG,EA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EAAUE,EACVA,EAAcF,EAAQ,aAExB,MAAMvB,EAAMwB,EAAUC,CAAW,EAC3BI,EAAe,CACnB,KAAMN,EAAQ,KACd,UAAWA,EAAQ,UACnB,eAAgBA,EAAQ,eACxB,qBAAsBA,EAAQ,qBAC9B,yBAA0BA,EAAQ,yBAClC,yBAA0BA,EAAQ,wBACpC,EACMW,EAAWP,EAAc3B,EAAK4B,EAAQC,CAAY,EACxD,OAAO,SAAUP,EAAMf,EAAOgB,EAAS,CASrC,GARI,OAAOD,GAAS,UAAYA,aAAgB,QAC9CC,EAAUhB,EACVA,EAAQe,EACRA,EAAOvB,EAAS,MAAMQ,EAAOgB,CAAO,GACzB,OAAOhB,GAAU,UAAYA,aAAiB,SACzDgB,EAAUhB,EACVA,EAAQ,QAEN2B,EAASZ,CAAI,EACf,OAAOA,EAET,MAAMF,EAAYc,EAAS,OAAQZ,EAAMf,EAAOgB,CAAO,CACzD,CACF,CAEAnB,EAAQ,QAAU6B,EAElB,OAAO,eAAe7B,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,CAC9D,CAAC",
|
|
6
|
+
"names": ["global", "factory", "jsonlint", "ajv", "requireAjv", "name", "exported", "exports", "addErrorLocation", "problem", "input", "tokens", "dataPath", "token", "location", "offset", "line", "column", "texts", "errorToProblem", "error", "schemaPath", "reason", "createError", "errors", "data", "options", "createAjv", "environment", "Ajv", "compileSchema", "schema", "parseOptions", "parsed", "originalError", "betterError", "compile", "validate"]
|
|
7
7
|
}
|
package/lib/schema-drafts.js
DELETED
|
@@ -1,482 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports)
|
|
3
|
-
: typeof define === 'function' && define.amd ? define('jsonlintSchemaDrafts', ['exports'], factory)
|
|
4
|
-
: (global = global || self, factory(global.jsonlintSchemaDrafts = {}));
|
|
5
|
-
}(this, function (exports) { 'use strict';
|
|
6
|
-
|
|
7
|
-
exports["json-schema-draft-04"] = {
|
|
8
|
-
"id": "http://json-schema.org/draft-04/schema#",
|
|
9
|
-
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
10
|
-
"description": "Core schema meta-schema",
|
|
11
|
-
"definitions": {
|
|
12
|
-
"schemaArray": {
|
|
13
|
-
"type": "array",
|
|
14
|
-
"minItems": 1,
|
|
15
|
-
"items": { "$ref": "#" }
|
|
16
|
-
},
|
|
17
|
-
"positiveInteger": {
|
|
18
|
-
"type": "integer",
|
|
19
|
-
"minimum": 0
|
|
20
|
-
},
|
|
21
|
-
"positiveIntegerDefault0": {
|
|
22
|
-
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
|
|
23
|
-
},
|
|
24
|
-
"simpleTypes": {
|
|
25
|
-
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
|
|
26
|
-
},
|
|
27
|
-
"stringArray": {
|
|
28
|
-
"type": "array",
|
|
29
|
-
"items": { "type": "string" },
|
|
30
|
-
"minItems": 1,
|
|
31
|
-
"uniqueItems": true
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"type": "object",
|
|
35
|
-
"properties": {
|
|
36
|
-
"id": {
|
|
37
|
-
"type": "string"
|
|
38
|
-
},
|
|
39
|
-
"$schema": {
|
|
40
|
-
"type": "string"
|
|
41
|
-
},
|
|
42
|
-
"title": {
|
|
43
|
-
"type": "string"
|
|
44
|
-
},
|
|
45
|
-
"description": {
|
|
46
|
-
"type": "string"
|
|
47
|
-
},
|
|
48
|
-
"default": {},
|
|
49
|
-
"multipleOf": {
|
|
50
|
-
"type": "number",
|
|
51
|
-
"minimum": 0,
|
|
52
|
-
"exclusiveMinimum": true
|
|
53
|
-
},
|
|
54
|
-
"maximum": {
|
|
55
|
-
"type": "number"
|
|
56
|
-
},
|
|
57
|
-
"exclusiveMaximum": {
|
|
58
|
-
"type": "boolean",
|
|
59
|
-
"default": false
|
|
60
|
-
},
|
|
61
|
-
"minimum": {
|
|
62
|
-
"type": "number"
|
|
63
|
-
},
|
|
64
|
-
"exclusiveMinimum": {
|
|
65
|
-
"type": "boolean",
|
|
66
|
-
"default": false
|
|
67
|
-
},
|
|
68
|
-
"maxLength": { "$ref": "#/definitions/positiveInteger" },
|
|
69
|
-
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
|
70
|
-
"pattern": {
|
|
71
|
-
"type": "string",
|
|
72
|
-
"format": "regex"
|
|
73
|
-
},
|
|
74
|
-
"additionalItems": {
|
|
75
|
-
"anyOf": [
|
|
76
|
-
{ "type": "boolean" },
|
|
77
|
-
{ "$ref": "#" }
|
|
78
|
-
],
|
|
79
|
-
"default": {}
|
|
80
|
-
},
|
|
81
|
-
"items": {
|
|
82
|
-
"anyOf": [
|
|
83
|
-
{ "$ref": "#" },
|
|
84
|
-
{ "$ref": "#/definitions/schemaArray" }
|
|
85
|
-
],
|
|
86
|
-
"default": {}
|
|
87
|
-
},
|
|
88
|
-
"maxItems": { "$ref": "#/definitions/positiveInteger" },
|
|
89
|
-
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
|
90
|
-
"uniqueItems": {
|
|
91
|
-
"type": "boolean",
|
|
92
|
-
"default": false
|
|
93
|
-
},
|
|
94
|
-
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
|
|
95
|
-
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
|
96
|
-
"required": { "$ref": "#/definitions/stringArray" },
|
|
97
|
-
"additionalProperties": {
|
|
98
|
-
"anyOf": [
|
|
99
|
-
{ "type": "boolean" },
|
|
100
|
-
{ "$ref": "#" }
|
|
101
|
-
],
|
|
102
|
-
"default": {}
|
|
103
|
-
},
|
|
104
|
-
"definitions": {
|
|
105
|
-
"type": "object",
|
|
106
|
-
"additionalProperties": { "$ref": "#" },
|
|
107
|
-
"default": {}
|
|
108
|
-
},
|
|
109
|
-
"properties": {
|
|
110
|
-
"type": "object",
|
|
111
|
-
"additionalProperties": { "$ref": "#" },
|
|
112
|
-
"default": {}
|
|
113
|
-
},
|
|
114
|
-
"patternProperties": {
|
|
115
|
-
"type": "object",
|
|
116
|
-
"additionalProperties": { "$ref": "#" },
|
|
117
|
-
"default": {}
|
|
118
|
-
},
|
|
119
|
-
"dependencies": {
|
|
120
|
-
"type": "object",
|
|
121
|
-
"additionalProperties": {
|
|
122
|
-
"anyOf": [
|
|
123
|
-
{ "$ref": "#" },
|
|
124
|
-
{ "$ref": "#/definitions/stringArray" }
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"enum": {
|
|
129
|
-
"type": "array",
|
|
130
|
-
"minItems": 1,
|
|
131
|
-
"uniqueItems": true
|
|
132
|
-
},
|
|
133
|
-
"type": {
|
|
134
|
-
"anyOf": [
|
|
135
|
-
{ "$ref": "#/definitions/simpleTypes" },
|
|
136
|
-
{
|
|
137
|
-
"type": "array",
|
|
138
|
-
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
139
|
-
"minItems": 1,
|
|
140
|
-
"uniqueItems": true
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
},
|
|
144
|
-
"format": { "type": "string" },
|
|
145
|
-
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
146
|
-
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
147
|
-
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
148
|
-
"not": { "$ref": "#" }
|
|
149
|
-
},
|
|
150
|
-
"dependencies": {
|
|
151
|
-
"exclusiveMaximum": [ "maximum" ],
|
|
152
|
-
"exclusiveMinimum": [ "minimum" ]
|
|
153
|
-
},
|
|
154
|
-
"default": {}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
exports["json-schema-draft-06"] = {
|
|
158
|
-
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
159
|
-
"$id": "http://json-schema.org/draft-06/schema#",
|
|
160
|
-
"title": "Core schema meta-schema",
|
|
161
|
-
"definitions": {
|
|
162
|
-
"schemaArray": {
|
|
163
|
-
"type": "array",
|
|
164
|
-
"minItems": 1,
|
|
165
|
-
"items": { "$ref": "#" }
|
|
166
|
-
},
|
|
167
|
-
"nonNegativeInteger": {
|
|
168
|
-
"type": "integer",
|
|
169
|
-
"minimum": 0
|
|
170
|
-
},
|
|
171
|
-
"nonNegativeIntegerDefault0": {
|
|
172
|
-
"allOf": [
|
|
173
|
-
{ "$ref": "#/definitions/nonNegativeInteger" },
|
|
174
|
-
{ "default": 0 }
|
|
175
|
-
]
|
|
176
|
-
},
|
|
177
|
-
"simpleTypes": {
|
|
178
|
-
"enum": [
|
|
179
|
-
"array",
|
|
180
|
-
"boolean",
|
|
181
|
-
"integer",
|
|
182
|
-
"null",
|
|
183
|
-
"number",
|
|
184
|
-
"object",
|
|
185
|
-
"string"
|
|
186
|
-
]
|
|
187
|
-
},
|
|
188
|
-
"stringArray": {
|
|
189
|
-
"type": "array",
|
|
190
|
-
"items": { "type": "string" },
|
|
191
|
-
"uniqueItems": true,
|
|
192
|
-
"default": []
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
"type": ["object", "boolean"],
|
|
196
|
-
"properties": {
|
|
197
|
-
"$id": {
|
|
198
|
-
"type": "string",
|
|
199
|
-
"format": "uri-reference"
|
|
200
|
-
},
|
|
201
|
-
"$schema": {
|
|
202
|
-
"type": "string",
|
|
203
|
-
"format": "uri"
|
|
204
|
-
},
|
|
205
|
-
"$ref": {
|
|
206
|
-
"type": "string",
|
|
207
|
-
"format": "uri-reference"
|
|
208
|
-
},
|
|
209
|
-
"title": {
|
|
210
|
-
"type": "string"
|
|
211
|
-
},
|
|
212
|
-
"description": {
|
|
213
|
-
"type": "string"
|
|
214
|
-
},
|
|
215
|
-
"default": {},
|
|
216
|
-
"examples": {
|
|
217
|
-
"type": "array",
|
|
218
|
-
"items": {}
|
|
219
|
-
},
|
|
220
|
-
"multipleOf": {
|
|
221
|
-
"type": "number",
|
|
222
|
-
"exclusiveMinimum": 0
|
|
223
|
-
},
|
|
224
|
-
"maximum": {
|
|
225
|
-
"type": "number"
|
|
226
|
-
},
|
|
227
|
-
"exclusiveMaximum": {
|
|
228
|
-
"type": "number"
|
|
229
|
-
},
|
|
230
|
-
"minimum": {
|
|
231
|
-
"type": "number"
|
|
232
|
-
},
|
|
233
|
-
"exclusiveMinimum": {
|
|
234
|
-
"type": "number"
|
|
235
|
-
},
|
|
236
|
-
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
237
|
-
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
238
|
-
"pattern": {
|
|
239
|
-
"type": "string",
|
|
240
|
-
"format": "regex"
|
|
241
|
-
},
|
|
242
|
-
"additionalItems": { "$ref": "#" },
|
|
243
|
-
"items": {
|
|
244
|
-
"anyOf": [
|
|
245
|
-
{ "$ref": "#" },
|
|
246
|
-
{ "$ref": "#/definitions/schemaArray" }
|
|
247
|
-
],
|
|
248
|
-
"default": {}
|
|
249
|
-
},
|
|
250
|
-
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
251
|
-
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
252
|
-
"uniqueItems": {
|
|
253
|
-
"type": "boolean",
|
|
254
|
-
"default": false
|
|
255
|
-
},
|
|
256
|
-
"contains": { "$ref": "#" },
|
|
257
|
-
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
258
|
-
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
259
|
-
"required": { "$ref": "#/definitions/stringArray" },
|
|
260
|
-
"additionalProperties": { "$ref": "#" },
|
|
261
|
-
"definitions": {
|
|
262
|
-
"type": "object",
|
|
263
|
-
"additionalProperties": { "$ref": "#" },
|
|
264
|
-
"default": {}
|
|
265
|
-
},
|
|
266
|
-
"properties": {
|
|
267
|
-
"type": "object",
|
|
268
|
-
"additionalProperties": { "$ref": "#" },
|
|
269
|
-
"default": {}
|
|
270
|
-
},
|
|
271
|
-
"patternProperties": {
|
|
272
|
-
"type": "object",
|
|
273
|
-
"additionalProperties": { "$ref": "#" },
|
|
274
|
-
"default": {}
|
|
275
|
-
},
|
|
276
|
-
"dependencies": {
|
|
277
|
-
"type": "object",
|
|
278
|
-
"additionalProperties": {
|
|
279
|
-
"anyOf": [
|
|
280
|
-
{ "$ref": "#" },
|
|
281
|
-
{ "$ref": "#/definitions/stringArray" }
|
|
282
|
-
]
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
"propertyNames": { "$ref": "#" },
|
|
286
|
-
"const": {},
|
|
287
|
-
"enum": {
|
|
288
|
-
"type": "array",
|
|
289
|
-
"minItems": 1,
|
|
290
|
-
"uniqueItems": true
|
|
291
|
-
},
|
|
292
|
-
"type": {
|
|
293
|
-
"anyOf": [
|
|
294
|
-
{ "$ref": "#/definitions/simpleTypes" },
|
|
295
|
-
{
|
|
296
|
-
"type": "array",
|
|
297
|
-
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
298
|
-
"minItems": 1,
|
|
299
|
-
"uniqueItems": true
|
|
300
|
-
}
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
"format": { "type": "string" },
|
|
304
|
-
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
305
|
-
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
306
|
-
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
307
|
-
"not": { "$ref": "#" }
|
|
308
|
-
},
|
|
309
|
-
"default": {}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
exports["json-schema-draft-07"] = {
|
|
313
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
314
|
-
"$id": "http://json-schema.org/draft-07/schema#",
|
|
315
|
-
"title": "Core schema meta-schema",
|
|
316
|
-
"definitions": {
|
|
317
|
-
"schemaArray": {
|
|
318
|
-
"type": "array",
|
|
319
|
-
"minItems": 1,
|
|
320
|
-
"items": { "$ref": "#" }
|
|
321
|
-
},
|
|
322
|
-
"nonNegativeInteger": {
|
|
323
|
-
"type": "integer",
|
|
324
|
-
"minimum": 0
|
|
325
|
-
},
|
|
326
|
-
"nonNegativeIntegerDefault0": {
|
|
327
|
-
"allOf": [
|
|
328
|
-
{ "$ref": "#/definitions/nonNegativeInteger" },
|
|
329
|
-
{ "default": 0 }
|
|
330
|
-
]
|
|
331
|
-
},
|
|
332
|
-
"simpleTypes": {
|
|
333
|
-
"enum": [
|
|
334
|
-
"array",
|
|
335
|
-
"boolean",
|
|
336
|
-
"integer",
|
|
337
|
-
"null",
|
|
338
|
-
"number",
|
|
339
|
-
"object",
|
|
340
|
-
"string"
|
|
341
|
-
]
|
|
342
|
-
},
|
|
343
|
-
"stringArray": {
|
|
344
|
-
"type": "array",
|
|
345
|
-
"items": { "type": "string" },
|
|
346
|
-
"uniqueItems": true,
|
|
347
|
-
"default": []
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
"type": ["object", "boolean"],
|
|
351
|
-
"properties": {
|
|
352
|
-
"$id": {
|
|
353
|
-
"type": "string",
|
|
354
|
-
"format": "uri-reference"
|
|
355
|
-
},
|
|
356
|
-
"$schema": {
|
|
357
|
-
"type": "string",
|
|
358
|
-
"format": "uri"
|
|
359
|
-
},
|
|
360
|
-
"$ref": {
|
|
361
|
-
"type": "string",
|
|
362
|
-
"format": "uri-reference"
|
|
363
|
-
},
|
|
364
|
-
"$comment": {
|
|
365
|
-
"type": "string"
|
|
366
|
-
},
|
|
367
|
-
"title": {
|
|
368
|
-
"type": "string"
|
|
369
|
-
},
|
|
370
|
-
"description": {
|
|
371
|
-
"type": "string"
|
|
372
|
-
},
|
|
373
|
-
"default": true,
|
|
374
|
-
"readOnly": {
|
|
375
|
-
"type": "boolean",
|
|
376
|
-
"default": false
|
|
377
|
-
},
|
|
378
|
-
"examples": {
|
|
379
|
-
"type": "array",
|
|
380
|
-
"items": true
|
|
381
|
-
},
|
|
382
|
-
"multipleOf": {
|
|
383
|
-
"type": "number",
|
|
384
|
-
"exclusiveMinimum": 0
|
|
385
|
-
},
|
|
386
|
-
"maximum": {
|
|
387
|
-
"type": "number"
|
|
388
|
-
},
|
|
389
|
-
"exclusiveMaximum": {
|
|
390
|
-
"type": "number"
|
|
391
|
-
},
|
|
392
|
-
"minimum": {
|
|
393
|
-
"type": "number"
|
|
394
|
-
},
|
|
395
|
-
"exclusiveMinimum": {
|
|
396
|
-
"type": "number"
|
|
397
|
-
},
|
|
398
|
-
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
399
|
-
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
400
|
-
"pattern": {
|
|
401
|
-
"type": "string",
|
|
402
|
-
"format": "regex"
|
|
403
|
-
},
|
|
404
|
-
"additionalItems": { "$ref": "#" },
|
|
405
|
-
"items": {
|
|
406
|
-
"anyOf": [
|
|
407
|
-
{ "$ref": "#" },
|
|
408
|
-
{ "$ref": "#/definitions/schemaArray" }
|
|
409
|
-
],
|
|
410
|
-
"default": true
|
|
411
|
-
},
|
|
412
|
-
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
413
|
-
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
414
|
-
"uniqueItems": {
|
|
415
|
-
"type": "boolean",
|
|
416
|
-
"default": false
|
|
417
|
-
},
|
|
418
|
-
"contains": { "$ref": "#" },
|
|
419
|
-
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
420
|
-
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
421
|
-
"required": { "$ref": "#/definitions/stringArray" },
|
|
422
|
-
"additionalProperties": { "$ref": "#" },
|
|
423
|
-
"definitions": {
|
|
424
|
-
"type": "object",
|
|
425
|
-
"additionalProperties": { "$ref": "#" },
|
|
426
|
-
"default": {}
|
|
427
|
-
},
|
|
428
|
-
"properties": {
|
|
429
|
-
"type": "object",
|
|
430
|
-
"additionalProperties": { "$ref": "#" },
|
|
431
|
-
"default": {}
|
|
432
|
-
},
|
|
433
|
-
"patternProperties": {
|
|
434
|
-
"type": "object",
|
|
435
|
-
"additionalProperties": { "$ref": "#" },
|
|
436
|
-
"propertyNames": { "format": "regex" },
|
|
437
|
-
"default": {}
|
|
438
|
-
},
|
|
439
|
-
"dependencies": {
|
|
440
|
-
"type": "object",
|
|
441
|
-
"additionalProperties": {
|
|
442
|
-
"anyOf": [
|
|
443
|
-
{ "$ref": "#" },
|
|
444
|
-
{ "$ref": "#/definitions/stringArray" }
|
|
445
|
-
]
|
|
446
|
-
}
|
|
447
|
-
},
|
|
448
|
-
"propertyNames": { "$ref": "#" },
|
|
449
|
-
"const": true,
|
|
450
|
-
"enum": {
|
|
451
|
-
"type": "array",
|
|
452
|
-
"items": true,
|
|
453
|
-
"minItems": 1,
|
|
454
|
-
"uniqueItems": true
|
|
455
|
-
},
|
|
456
|
-
"type": {
|
|
457
|
-
"anyOf": [
|
|
458
|
-
{ "$ref": "#/definitions/simpleTypes" },
|
|
459
|
-
{
|
|
460
|
-
"type": "array",
|
|
461
|
-
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
462
|
-
"minItems": 1,
|
|
463
|
-
"uniqueItems": true
|
|
464
|
-
}
|
|
465
|
-
]
|
|
466
|
-
},
|
|
467
|
-
"format": { "type": "string" },
|
|
468
|
-
"contentMediaType": { "type": "string" },
|
|
469
|
-
"contentEncoding": { "type": "string" },
|
|
470
|
-
"if": {"$ref": "#"},
|
|
471
|
-
"then": {"$ref": "#"},
|
|
472
|
-
"else": {"$ref": "#"},
|
|
473
|
-
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
474
|
-
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
475
|
-
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
476
|
-
"not": { "$ref": "#" }
|
|
477
|
-
},
|
|
478
|
-
"default": true
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
482
|
-
}));
|