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