Skip to content

Commit a125e2e

Browse files
authored
Merge pull request #214 from FadySalama/develop
upgrade ajv, add ajv-formats, update all schemas to version 0.7
2 parents 677876c + d9d0fb0 commit a125e2e

File tree

174 files changed

+8375
-6599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+8375
-6599
lines changed

package-lock.json

Lines changed: 78 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/assertions/assertionTests.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const isUtf8 = require('is-utf8')
33

44
// The usual library used for validation
55
const Ajv = require('ajv')
6+
const addFormats = require("ajv-formats")
7+
68

79
// Imports from playground core
810
const checkUniqueness = require('@thing-description-playground/core').propUniqueness
@@ -86,6 +88,9 @@ function validate(tdData, assertions, manualAssertions, logFunc) {
8688
}
8789
const ajv = new Ajv(ajvOptions)
8890
ajv.addSchema(schema, 'td')
91+
ajv.addVocabulary(['is-complex', 'also']);
92+
addFormats(ajv)
93+
8994

9095

9196
const valid = ajv.validate('td', tdJson)
@@ -261,6 +266,8 @@ function checkVocabulary(tdJson) {
261266
const results = []
262267
const ajv = new Ajv()
263268
ajv.addSchema(tdSchema, 'td')
269+
ajv.addVocabulary(['is-complex', 'also']);
270+
addFormats(ajv)
264271

265272
const valid = ajv.validate('td', tdJson)
266273
const otherAssertions = ["td-objects_securityDefinitions", "td-arrays_security", "td-vocab-security--Thing",

packages/assertions/assertions/td-action-arrays.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
22
"title": "td-action-arrays",
33
"description": "The type of the members forms MUST be serialized as a JSON array.",
4-
"$schema ": "http://json-schema.org/draft-06/schema#",
4+
"$schema": "http://json-schema.org/draft-07/schema#",
55
"is-complex":false,
66
"also": ["td-action-names_forms"],
77
"type": "object",
88
"properties": {
99
"actions": {
1010
"additionalProperties": {
11-
"$ref": "#/definitions/action_element"
11+
"$ref": "#/$defs/action_element"
1212
}
1313
}
1414
},
1515
"required": [
1616
"actions"
1717
],
1818
"additionalProperties": true,
19-
"definitions": {
19+
"$defs": {
2020
"action_element": {
2121
"type": "object",
2222
"properties": {
2323
"forms": {
2424
"type": "array",
2525
"items": {
26-
"$ref": "#/definitions/form_element"
26+
"$ref": "#/$defs/form_element"
2727
}
2828
}
2929

@@ -37,7 +37,7 @@
3737
"type": "object",
3838
"properties": {
3939
"href": {
40-
"$ref": "#/definitions/url"
40+
"$ref": "#/$defs/url"
4141
},
4242
"op": {
4343
"oneOf": [{

packages/assertions/assertions/td-action-names_at-type.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"title": "td-action-names_at-type",
33
"description": "Each optional vocabulary term as defined in the class Action and its superclass InteractionPattern MUST be serialized as a JSON name within an Action object.",
4-
"$schema ": "http://json-schema.org/draft-06/schema#",
4+
"$schema": "http://json-schema.org/draft-07/schema#",
55
"is-complex":true,
66
"type": "object",
77
"properties": {
88
"actions": {
99
"additionalProperties": {
10-
"$ref": "#/definitions/action_element"
10+
"$ref": "#/$defs/action_element"
1111
}
1212
}
1313
},
1414
"additionalProperties": true,
15-
"definitions": {
15+
"$defs": {
1616
"action_element": {
1717
"if": {
1818
"type": "object",

packages/assertions/assertions/td-action-names_description.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"title": "td-action-names_description",
33
"description": "Each optional vocabulary term as defined in the class Action and its superclass InteractionPattern MUST be serialized as a JSON name within an Action object.",
4-
"$schema ": "http://json-schema.org/draft-06/schema#",
4+
"$schema": "http://json-schema.org/draft-07/schema#",
55
"is-complex":true,
66
"type": "object",
77
"properties": {
88
"actions": {
99
"additionalProperties": {
10-
"$ref": "#/definitions/action_element"
10+
"$ref": "#/$defs/action_element"
1111
}
1212
}
1313
},
1414
"additionalProperties": true,
15-
"definitions": {
15+
"$defs": {
1616
"action_element": {
1717
"if": {
1818
"type": "object",

packages/assertions/assertions/td-action-names_descriptions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"title": "td-action-names_descriptions",
33
"description": "Each optional vocabulary term as defined in the class Action and its superclass InteractionPattern MUST be serialized as a JSON name within an Action object.",
4-
"$schema ": "http://json-schema.org/draft-06/schema#",
4+
"$schema": "http://json-schema.org/draft-07/schema#",
55
"is-complex":true,
66
"type": "object",
77
"properties": {
88
"actions": {
99
"additionalProperties": {
10-
"$ref": "#/definitions/action_element"
10+
"$ref": "#/$defs/action_element"
1111
}
1212
}
1313
},
1414
"additionalProperties": true,
15-
"definitions": {
15+
"$defs": {
1616
"action_element": {
1717
"if": {
1818
"type": "object",

packages/assertions/assertions/td-action-names_title.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"title": "td-action-names_title",
33
"description": "Each optional vocabulary term as defined in the class Action and its superclass InteractionPattern MUST be serialized as a JSON name within an Action object.",
4-
"$schema ": "http://json-schema.org/draft-06/schema#",
4+
"$schema": "http://json-schema.org/draft-07/schema#",
55
"is-complex":true,
66
"type": "object",
77
"properties": {
88
"actions": {
99
"additionalProperties": {
10-
"$ref": "#/definitions/action_element"
10+
"$ref": "#/$defs/action_element"
1111
}
1212
}
1313
},
1414
"additionalProperties": true,
15-
"definitions": {
15+
"$defs": {
1616
"action_element": {
1717
"if": {
1818
"type": "object",

packages/assertions/assertions/td-action-names_titles.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"title": "td-action-names_titles",
33
"description": "Each optional vocabulary term as defined in the class Action and its superclass InteractionPattern MUST be serialized as a JSON name within an Action object.",
4-
"$schema ": "http://json-schema.org/draft-06/schema#",
4+
"$schema": "http://json-schema.org/draft-07/schema#",
55
"is-complex":true,
66
"type": "object",
77
"properties": {
88
"actions": {
99
"additionalProperties": {
10-
"$ref": "#/definitions/action_element"
10+
"$ref": "#/$defs/action_element"
1111
}
1212
}
1313
},
1414
"additionalProperties": true,
15-
"definitions": {
15+
"$defs": {
1616
"action_element": {
1717
"if": {
1818
"type": "object",

0 commit comments

Comments
 (0)