spellbook.json 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "definitions": {
  4. "names": {
  5. "items": {"type": "string"},
  6. "type": "array"
  7. }
  8. },
  9. "properties": {
  10. "@class": {"type": "string"},
  11. "classRef": {"type": "string"},
  12. "spellInfo": {
  13. "dependencies":{
  14. "2":["1"],
  15. "3":["2"],
  16. "4":["3"],
  17. "5":["4"],
  18. "6":["5"],
  19. "7":["6"],
  20. "8":["7"],
  21. "9":["8"]
  22. },
  23. "patternProperties": {
  24. "^[0-9]$": {
  25. "properties": {
  26. "spellsPerDay": {"type": "integer"},
  27. "spellsPerDayRemaining": {"type": "integer"},
  28. "spellsKnown": {"$ref": "#/definitions/names"},
  29. "spellsPrepared": {"$ref": "#/definitions/names"},
  30. "spellsPreparedPreviously": {"$ref": "#/definitions/names"}
  31. },
  32. "type": "object"
  33. }
  34. },
  35. "type": "object"
  36. }
  37. },
  38. "oneOf": [
  39. {
  40. "properties": {
  41. "@class": {
  42. "enum": [
  43. "org.leumasjaffe.charsheet.model.magic.impl.Inspired"
  44. ]
  45. },
  46. "spellInfo": {
  47. "^[0-9]$": {
  48. "required": [
  49. "spellsPerDay",
  50. "spellsPrepared",
  51. "spellsPreparedPreviously"
  52. ],
  53. "additionalProperties":false
  54. }
  55. }
  56. },
  57. "required": ["classRef"]
  58. },
  59. {
  60. "properties": {
  61. "@class": {
  62. "enum": [
  63. "org.leumasjaffe.charsheet.model.magic.impl.Spontaneous"
  64. ]
  65. },
  66. "spellInfo": {
  67. "^[0-9]$": {
  68. "required": [
  69. "spellsPerDay",
  70. "spellsPerDayRemaining",
  71. "spellsKnown"
  72. ],
  73. "additionalProperties":false
  74. }
  75. }
  76. }
  77. },
  78. {
  79. "properties": {
  80. "@class": {
  81. "enum": [
  82. "org.leumasjaffe.charsheet.model.magic.impl.Researched"
  83. ]
  84. },
  85. "spellInfo": {
  86. "^[0-9]$": {
  87. "required": [
  88. "spellsPerDay",
  89. "spellsKnown",
  90. "spellsPrepared",
  91. "spellsPreparedPreviously"
  92. ],
  93. "additionalProperties":false
  94. }
  95. }
  96. }
  97. },
  98. {
  99. "properties": {
  100. "@class": {
  101. "enum": [
  102. "org.leumasjaffe.charsheet.model.magic.impl.Retrieved"
  103. ]
  104. },
  105. "spellInfo": {
  106. "^[0-9]$": {
  107. "required": [
  108. "spellsPerDay",
  109. "spellsPerDayRemaining",
  110. "spellsPrepared",
  111. "spellsPreparedPreviously"
  112. ],
  113. "additionalProperties":false
  114. }
  115. }
  116. },
  117. "required": ["classRef"]
  118. }
  119. ],
  120. "required": [
  121. "@class",
  122. "spellInfo"
  123. ],
  124. "type": "object"
  125. }