spellbook_schema.json 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. "patternProperties": {
  14. "^[0-9]$": {
  15. "properties": {
  16. "spellsPerDay": {"type": "integer"},
  17. "spellsPerDayRemaining": {"type": "integer"},
  18. "spellsKnown": {"$ref": "#/definitions/names"},
  19. "spellsPrepared": {"$ref": "#/definitions/names"},
  20. "spellsPreparedPreviously": {"$ref": "#/definitions/names"}
  21. },
  22. "type": "object"
  23. }
  24. },
  25. "type": "object"
  26. }
  27. },
  28. "oneOf": [
  29. {
  30. "properties": {
  31. "@class": {
  32. "enum": [
  33. "org.leumasjaffe.charsheet.model.magic.impl.Inspired"
  34. ]
  35. },
  36. "spellInfo": {
  37. "^[0-9]$": {
  38. "required": [
  39. "spellsPerDay",
  40. "spellsPrepared",
  41. "spellsPreparedPreviously"
  42. ],
  43. "additionalProperties":false
  44. }
  45. }
  46. }
  47. },
  48. {
  49. "properties": {
  50. "@class": {
  51. "enum": [
  52. "org.leumasjaffe.charsheet.model.magic.impl.Spontaneous"
  53. ]
  54. },
  55. "spellInfo": {
  56. "^[0-9]$": {
  57. "required": [
  58. "spellsPerDay",
  59. "spellsPerDayRemaining",
  60. "spellsKnown"
  61. ],
  62. "additionalProperties":false
  63. }
  64. }
  65. }
  66. },
  67. {
  68. "properties": {
  69. "@class": {
  70. "enum": [
  71. "org.leumasjaffe.charsheet.model.magic.impl.Researched",
  72. "org.leumasjaffe.charsheet.model.magic.impl.Unearthed"
  73. ]
  74. },
  75. "spellInfo": {
  76. "^[0-9]$": {
  77. "required": [
  78. "spellsPerDay",
  79. "spellsPerDayRemaining",
  80. "spellsKnown",
  81. "spellsPrepared",
  82. "spellsPreparedPreviously"
  83. ],
  84. "additionalProperties":false
  85. }
  86. }
  87. }
  88. }
  89. ],
  90. "required": [
  91. "@class",
  92. "classRef",
  93. "spellInfo"
  94. ],
  95. "type": "object"
  96. }