{ "$schema": "http://json-schema.org/draft-06/schema#", "definitions": { "names": { "items": {"type": "string"}, "type": "array" } }, "properties": { "@class": {"type": "string"}, "classRef": {"type": "string"}, "spellInfo": { "dependencies":{ "2":["1"], "3":["2"], "4":["3"], "5":["4"], "6":["5"], "7":["6"], "8":["7"], "9":["8"] }, "patternProperties": { "^[0-9]$": { "properties": { "spellsPerDay": {"type": "integer"}, "spellsPerDayRemaining": {"type": "integer"}, "spellsKnown": {"$ref": "#/definitions/names"}, "spellsPrepared": {"$ref": "#/definitions/names"}, "spellsPreparedPreviously": {"$ref": "#/definitions/names"} }, "type": "object" } }, "type": "object" } }, "oneOf": [ { "properties": { "@class": { "const": "org.leumasjaffe.charsheet.model.magic.impl.Inspired" }, "spellInfo": { "^[0-9]$": { "required": [ "spellsPerDay", "spellsPrepared", "spellsPreparedPreviously" ], "additionalProperties":false } } }, "required": ["classRef"] }, { "properties": { "@class": { "const": "org.leumasjaffe.charsheet.model.magic.impl.Spontaneous" }, "spellInfo": { "^[0-9]$": { "required": [ "spellsPerDay", "spellsPerDayRemaining", "spellsKnown" ], "additionalProperties":false } } } }, { "properties": { "@class": { "const": "org.leumasjaffe.charsheet.model.magic.impl.Researched" }, "spellInfo": { "^[0-9]$": { "required": [ "spellsPerDay", "spellsKnown", "spellsPrepared", "spellsPreparedPreviously" ], "additionalProperties":false } } } }, { "properties": { "@class": { "const": "org.leumasjaffe.charsheet.model.magic.impl.Retrieved" }, "spellInfo": { "^[0-9]$": { "required": [ "spellsPerDay", "spellsPerDayRemaining", "spellsPrepared", "spellsPreparedPreviously" ], "additionalProperties":false } } }, "required": ["classRef"] } ], "required": [ "@class", "spellInfo" ], "type": "object" }