|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2019-09/schema", |
| 3 | + "definitions": { |
| 4 | + "Character" : { |
| 5 | + "anyOf": [{ "$ref" : "#/definitions/Attacker" },{ "$ref" : "#/definitions/Rapunzel" },{ "$ref" : "#/definitions/BookReader" },{ "$ref" : "#/definitions/BookReader" },,] |
| 6 | + }, |
| 7 | + "Gadget" : { |
| 8 | + "anyOf": [{ "$ref" : "#/definitions/FallingTub" },{ "$ref" : "#/definitions/HandFan" }] |
| 9 | + }, |
| 10 | + "Attacker" : { |
| 11 | + "type" : "object", |
| 12 | + "properties" : { |
| 13 | + "sword_attack_damage" : { |
| 14 | + "type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647 |
| 15 | + } |
| 16 | + }, |
| 17 | + "additionalProperties" : false |
| 18 | + }, |
| 19 | + "Rapunzel" : { |
| 20 | + "type" : "object", |
| 21 | + "properties" : { |
| 22 | + "hair_length" : { |
| 23 | + "type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647 |
| 24 | + } |
| 25 | + }, |
| 26 | + "additionalProperties" : false |
| 27 | + }, |
| 28 | + "BookReader" : { |
| 29 | + "type" : "object", |
| 30 | + "properties" : { |
| 31 | + "books_read" : { |
| 32 | + "type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647 |
| 33 | + } |
| 34 | + }, |
| 35 | + "additionalProperties" : false |
| 36 | + }, |
| 37 | + "FallingTub" : { |
| 38 | + "type" : "object", |
| 39 | + "properties" : { |
| 40 | + "weight" : { |
| 41 | + "type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647 |
| 42 | + } |
| 43 | + }, |
| 44 | + "additionalProperties" : false |
| 45 | + }, |
| 46 | + "HandFan" : { |
| 47 | + "type" : "object", |
| 48 | + "properties" : { |
| 49 | + "length" : { |
| 50 | + "type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647 |
| 51 | + } |
| 52 | + }, |
| 53 | + "additionalProperties" : false |
| 54 | + }, |
| 55 | + "Movie" : { |
| 56 | + "type" : "object", |
| 57 | + "properties" : { |
| 58 | + "main_character_type" : { |
| 59 | + "type" : "string", "enum": ["NONE", "MuLan", "Rapunzel", "Belle", "BookFan", "Other", "Unused"] |
| 60 | + }, |
| 61 | + "main_character" : { |
| 62 | + "oneOf": [{ "type": "object", "properties": { "type": { "const": "MuLan" }, "value": { "$ref" : "#/definitions/Attacker" } }, "required": ["type", "value"] },{ "type": "object", "properties": { "type": { "const": "Rapunzel" }, "value": { "$ref" : "#/definitions/Rapunzel" } }, "required": ["type", "value"] },{ "type": "object", "properties": { "type": { "const": "Belle" }, "value": { "$ref" : "#/definitions/BookReader" } }, "required": ["type", "value"] },{ "type": "object", "properties": { "type": { "const": "BookFan" }, "value": { "$ref" : "#/definitions/BookReader" } }, "required": ["type", "value"] }] |
| 63 | + }, |
| 64 | + "characters_type" : { |
| 65 | + "type" : "array", "items" : {"$ref" : "#/definitions/Character"} |
| 66 | + }, |
| 67 | + "characters" : { |
| 68 | + "type" : "array", "items" : {"$ref" : "#/definitions/Character"} |
| 69 | + } |
| 70 | + }, |
| 71 | + "allOf": [ |
| 72 | + { |
| 73 | + "if": { |
| 74 | + "properties": { |
| 75 | + "main_character_type": { "const": "NONE" } |
| 76 | + } |
| 77 | + }, |
| 78 | + "then": { |
| 79 | + "not": { |
| 80 | + "required": ["main_character"] |
| 81 | + } |
| 82 | + } |
| 83 | + }, |
| 84 | + { |
| 85 | + "if": { |
| 86 | + "properties": { |
| 87 | + "main_character_type": { "const": "MuLan" } |
| 88 | + } |
| 89 | + }, |
| 90 | + "then": { |
| 91 | + "properties": { |
| 92 | + "main_character": { "$ref" : "#/definitions/Attacker" } |
| 93 | + } |
| 94 | + } |
| 95 | + }, |
| 96 | + { |
| 97 | + "if": { |
| 98 | + "properties": { |
| 99 | + "main_character_type": { "const": "Rapunzel" } |
| 100 | + } |
| 101 | + }, |
| 102 | + "then": { |
| 103 | + "properties": { |
| 104 | + "main_character": { "$ref" : "#/definitions/Rapunzel" } |
| 105 | + } |
| 106 | + } |
| 107 | + }, |
| 108 | + { |
| 109 | + "if": { |
| 110 | + "properties": { |
| 111 | + "main_character_type": { "const": "Belle" } |
| 112 | + } |
| 113 | + }, |
| 114 | + "then": { |
| 115 | + "properties": { |
| 116 | + "main_character": { "$ref" : "#/definitions/BookReader" } |
| 117 | + } |
| 118 | + } |
| 119 | + }, |
| 120 | + { |
| 121 | + "if": { |
| 122 | + "properties": { |
| 123 | + "main_character_type": { "const": "BookFan" } |
| 124 | + } |
| 125 | + }, |
| 126 | + "then": { |
| 127 | + "properties": { |
| 128 | + "main_character": { "$ref" : "#/definitions/BookReader" } |
| 129 | + } |
| 130 | + } |
| 131 | + } |
| 132 | + ], |
| 133 | + "additionalProperties" : false |
| 134 | + } |
| 135 | + }, |
| 136 | + "$ref" : "#/definitions/Movie" |
| 137 | +} |
0 commit comments