choiceSet.json (3764B)
1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "id": "choiceSet.json", 4 "title": "Definitions: Choice.", 5 "description": "Schemas in #/definitions detect or validate keys/objects used in describing Choice (Sections 3.2.7 and 3.2.8).", 6 "definitions": 7 { 8 9 "itemsDetected" : 10 { 11 "$schema": "http://json-schema.org/draft-04/schema#", 12 "title": "Definition: items", 13 "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).", 14 "type": "object", 15 "properties" : 16 { 17 "items" : 18 { 19 "type" : "array", 20 "minItems": 1, 21 "items": { 22 "oneOf": 23 [ 24 { "$ref": "specificResource.json#/definitions/specificeResourceDetected" }, 25 { "$ref": "bodyTarget.json#/definitions/externalWebResourceDetected" }, 26 { "$ref": "bodyTarget.json#/definitions/textualBodyFound" }, 27 { "$ref": "id.json#/definitions/stringUri" }, 28 { "allOf": 29 [ 30 { "$ref" : "#/definitions/choiceOrSetTypeDefinition" }, 31 { "$ref": "#/definitions/itemsDetected" } 32 ] 33 } 34 ] 35 } 36 } 37 }, 38 "required": [ "items" ] 39 }, 40 41 "choiceTypeDefinition": 42 { 43 "$schema": "http://json-schema.org/draft-04/schema#", 44 "title": "Definition: Choice type", 45 "description": "True when object has type key and object's type is 'Choice' (Section 3.2.7)", 46 "type": "object", 47 "properties": 48 { 49 "type": 50 { 51 "type": "string", 52 "enum": ["Choice"] 53 } 54 }, 55 "required": [ "type" ] 56 }, 57 58 "choiceOrSetTypeDefinition": 59 { 60 "$schema": "http://json-schema.org/draft-04/schema#", 61 "title": "Definition: Choice or Set type", 62 "description": "True when object has type key and object's type is any of 'Choice' (Section 3.2.7)", 63 "type": "object", 64 "properties": 65 { 66 "type": 67 { 68 "type": "string", 69 "enum": ["Choice"] 70 } 71 }, 72 "required": [ "type" ] 73 }, 74 75 "choiceDetected": { 76 "$schema": "http://json-schema.org/draft-04/schema#", 77 "title": "Detection: Choice", 78 "description": "True when object's type is 'Choice' and the object has an items array (Section 3.2.7)", 79 "type": "object", 80 "allOf": 81 [ 82 { "$ref": "#/definitions/choiceTypeDefinition" }, 83 { "$ref": "#/definitions/itemsDetected" } 84 ] 85 }, 86 87 "choiceOrSetDetected": { 88 "$schema": "http://json-schema.org/draft-04/schema#", 89 "title": "Detection: Choice or Set", 90 "description": "True when object's type is one of Choice and the object has an items array (Section 3.2.7)", 91 "type": "object", 92 "allOf": 93 [ 94 { "$ref": "#/definitions/choiceOrSetTypeDefinition" }, 95 { "$ref": "#/definitions/itemsDetected" } 96 ] 97 }, 98 99 "choiceSetWithValue" : 100 { 101 "allOf": 102 [ 103 { "$ref": "#/definitions/choiceOrSetDetected" }, 104 { "required": [ "value" ] } 105 ] 106 }, 107 108 "choiceSetWithSource" : 109 { 110 "allOf": 111 [ 112 { "$ref": "#/definitions/choiceOrSetDetected" }, 113 { "required": [ "source" ] } 114 ] 115 }, 116 117 "choiceSetWithPurpose" : 118 { 119 "allOf": 120 [ 121 { "$ref": "#/definitions/choiceOrSetDetected" }, 122 { "required": [ "purpose" ] } 123 ] 124 } 125 126 } 127 }