{ "$schema": "http://json-schema.org/draft-04/schema#", "definitions": { "names": { "items": {"type": "string"}, "type": "array" } }, "properties": { "@class": {"type": "string"}, "classRef": {"type": "string"}, "spellInfo": { "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": { "enum": [ "org.leumasjaffe.charsheet.model.magic.impl.Inspired" ] }, "spellInfo": { "^[0-9]$": { "required": [ "spellsPerDay", "spellsPrepared", "spellsPreparedPreviously" ], "additionalProperties":false } } } }, { "properties": { "@class": { "enum": [ "org.leumasjaffe.charsheet.model.magic.impl.Spontaneous" ] }, "spellInfo": { "^[0-9]$": { "required": [ "spellsPerDay", "spellsPerDayRemaining", "spellsKnown" ], "additionalProperties":false } } } }, { "properties": { "@class": { "enum": [ "org.leumasjaffe.charsheet.model.magic.impl.Researched", "org.leumasjaffe.charsheet.model.magic.impl.Unearthed" ] }, "spellInfo": { "^[0-9]$": { "required": [ "spellsPerDay", "spellsPerDayRemaining", "spellsKnown", "spellsPrepared", "spellsPreparedPreviously" ], "additionalProperties":false } } } } ], "required": [ "@class", "classRef", "spellInfo" ], "type": "object" }