summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/annotation-model/definitions/choiceSet.json
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/annotation-model/definitions/choiceSet.json')
-rw-r--r--testing/web-platform/tests/annotation-model/definitions/choiceSet.json214
1 files changed, 214 insertions, 0 deletions
diff --git a/testing/web-platform/tests/annotation-model/definitions/choiceSet.json b/testing/web-platform/tests/annotation-model/definitions/choiceSet.json
new file mode 100644
index 000000000..ffe21a0f0
--- /dev/null
+++ b/testing/web-platform/tests/annotation-model/definitions/choiceSet.json
@@ -0,0 +1,214 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "choiceSet.json",
+ "title": "Definitions: Choice, Composite, List, Independents.",
+ "description": "Schemas in #/definitions detect or validate keys/objects used in describing Choice, Composite, List, Independents (Sections 3.2.7 and 3.2.8).",
+ "definitions":
+ {
+
+ "itemsDetected" :
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: items",
+ "description": "True when the object includes items key and value of items is an array containing at least 1 item, which can be a specificResource, an externalWebResource, a uri, a textualBody or another choice/set (Sections 3.2.7 and 3.2.8).",
+ "type": "object",
+ "properties" :
+ {
+ "items" :
+ {
+ "type" : "array",
+ "minItems": 1,
+ "items": {
+ "oneOf":
+ [
+ { "$ref": "specificResource.json#/definitions/specificeResourceDetected" },
+ { "$ref": "bodyTarget.json#/definitions/externalWebResourceDetected" },
+ { "$ref": "bodyTarget.json#/definitions/textualBodyFound" },
+ { "$ref": "id.json#/definitions/stringUri" },
+ { "allOf":
+ [
+ { "$ref" : "#/definitions/choiceOrSetTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "required": [ "items" ]
+ },
+
+ "choiceTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Choice type",
+ "description": "True when object has type key and object's type is 'Choice' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["Choice"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "compositeTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Composite type",
+ "description": "True when object has type key and object's type is 'Composite' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["Composite"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "listTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: List type",
+ "description": "True when object has type key and object's type is 'List' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["List"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "independentsTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Independents type",
+ "description": "True when object has type key and object's type is 'Independents' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["Independents"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "choiceOrSetTypeDefinition":
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Definition: Choice or Set type",
+ "description": "True when object has type key and object's type is any of 'Choice', 'Composite', 'List', 'Independents' (Section 3.2.7)",
+ "type": "object",
+ "properties":
+ {
+ "type":
+ {
+ "type": "string",
+ "enum": ["Choice", "Composite", "List", "Independents"]
+ }
+ },
+ "required": [ "type" ]
+ },
+
+ "choiceDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Choice",
+ "description": "True when object's type is 'Choice' and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "compositeDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Composite",
+ "description": "True when object's type is 'Composite' and the object has an items array (Section 3.2.8)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/compositeTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "listDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: List",
+ "description": "True when object's type is 'List' and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/listTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "independentsDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Independents",
+ "description": "True when object's type is 'Independents' and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/independentsTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "choiceOrSetDetected": {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Detection: Choice or Set",
+ "description": "True when object's type is one of Choice, Composite, List or Independents and the object has an items array (Section 3.2.7)",
+ "type": "object",
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetTypeDefinition" },
+ { "$ref": "#/definitions/itemsDetected" }
+ ]
+ },
+
+ "choiceSetWithValue" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetDetected" },
+ { "required": [ "value" ] }
+ ]
+ },
+
+ "choiceSetWithSource" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetDetected" },
+ { "required": [ "source" ] }
+ ]
+ },
+
+ "choiceSetWithPurpose" :
+ {
+ "allOf":
+ [
+ { "$ref": "#/definitions/choiceOrSetDetected" },
+ { "required": [ "purpose" ] }
+ ]
+ }
+
+ }
+}