{ "properties": { "masterwork": {"type": "boolean"}, "bonus": {"$ref": "#/definitions/bonus"}, "enchantments": { "items": { "dependencies": { "effectiveBonus": {"properties": {"adHocValue": false}}, "adHocValue": {"properties": {"effectiveBonus": false}} }, "properties": { "name": {"type": "string"}, "effectiveBonus": {"$ref": "#/definitions/bonus"}, "adHocValue": {"$ref": "#/definitions/money"}, "canAttachTo": { "items": {"$ref": "#/definitions/attachCriteria"}, "type": "array" } }, "oneOf": [ {"required": ["name", "effectiveBonus"]}, {"required": ["name", "adHocValue"]} ] "type": "object" }, "type": "array" } }, "definitions": { "bonus": { "type": "string", "enum": ["+1", "+2", "+3", "+4", "+5"] }, "attachCriteria": { "items": { "enum": [ "Slashing", "Piercing", "Bludgeoning", "Ranged", "Armor", "Shield", "Light", "Medium", "Heavy", "One-Handed", "Two-Handed" ], "type": "string", "uniqueItems": true }, "type": "array" } } }