tpso.schema.json 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "https://example.com/tpso.schema.json",
  4. "title": "TPSO Mapping",
  5. "type": "object",
  6. "required": ["meta", "tpso", "codesTree", "zones", "codes", "crosswalk"],
  7. "properties": {
  8. "meta": {
  9. "type": "object",
  10. "required": ["version", "source"],
  11. "properties": {
  12. "version": { "type": "string" },
  13. "source": {
  14. "type": "array",
  15. "items": {
  16. "type": "object",
  17. "required": ["title", "url"],
  18. "properties": {
  19. "title": { "type": "string" },
  20. "url": { "type": "string", "format": "uri" }
  21. },
  22. "additionalProperties": false
  23. }
  24. },
  25. "notes": { "type": "string" }
  26. },
  27. "additionalProperties": true
  28. },
  29. "tpso": {
  30. "type": "object",
  31. "required": ["base", "effectiveForDate", "map"],
  32. "properties": {
  33. "base": { "type": "string", "format": "uri" },
  34. "effectiveForDate": { "type": "string" },
  35. "map": {
  36. "type": "object",
  37. "patternProperties": {
  38. "^(ADMINISTRATION_INDEX|GENERAL-PROVISIONS_INDEX|ZONES_INDEX|CODES_INDEX|([0-9]+(\\.[0-9]+)*))$": {
  39. "type": "integer",
  40. "minimum": 0
  41. }
  42. },
  43. "additionalProperties": false
  44. }
  45. },
  46. "additionalProperties": false
  47. },
  48. "codesTree": {
  49. "type": "array",
  50. "items": { "$ref": "#/$defs/CodeNode" }
  51. },
  52. "zones": {
  53. "type": "array",
  54. "items": {
  55. "type": "object",
  56. "required": ["name", "doc_section", "key_clauses"],
  57. "properties": {
  58. "name": { "type": "string" },
  59. "doc_section": { "type": "string", "pattern": "^[0-9]+(\\.[0-9]+)*$" },
  60. "key_clauses": {
  61. "type": "object",
  62. "properties": {
  63. "purpose": { "type": "string" },
  64. "use_table": { "type": "string" },
  65. "use_standards": { "type": "string" },
  66. "dev_standards_dwellings": { "type": "string" },
  67. "dev_standards_non_dwellings": { "type": "string" },
  68. "dev_standards_buildings_works": { "type": "string" },
  69. "subdivision": { "type": "string" }
  70. },
  71. "additionalProperties": false
  72. }
  73. },
  74. "additionalProperties": false
  75. }
  76. },
  77. "codes": {
  78. "type": "object",
  79. "patternProperties": {
  80. "^C[0-9]+$": {
  81. "type": "object",
  82. "properties": {
  83. "key_clauses": { "$ref": "#/$defs/KeyClauses" }
  84. },
  85. "additionalProperties": false
  86. }
  87. },
  88. "additionalProperties": false
  89. },
  90. "crosswalk": {
  91. "type": "object",
  92. "properties": {
  93. "aliases": {
  94. "type": "object",
  95. "patternProperties": {
  96. "^[a-z0-9_]+$": { "type": "string", "pattern": "^C[0-9]+$" }
  97. },
  98. "additionalProperties": false
  99. }
  100. },
  101. "additionalProperties": false
  102. }
  103. },
  104. "$defs": {
  105. "CodeNode": {
  106. "type": "object",
  107. "required": ["id", "title"],
  108. "properties": {
  109. "id": { "type": "integer" },
  110. "title": { "type": "string" },
  111. "children": {
  112. "type": "array",
  113. "items": { "$ref": "#/$defs/CodeNode" }
  114. }
  115. },
  116. "additionalProperties": false
  117. },
  118. "KeyClauses": {
  119. "type": "object",
  120. "properties": {
  121. "purpose": { "type": "string" },
  122. "application": { "type": "string" },
  123. "definitions": { "type": "string" },
  124. "exempt": { "type": "string" },
  125. "use_standards": { "type": "string" },
  126. "use_standards_detail": {
  127. "type": "array",
  128. "items": { "$ref": "#/$defs/ClauseDetail" }
  129. },
  130. "development_standards": { "type": "string" },
  131. "development_standards_detail": {
  132. "type": "array",
  133. "items": { "$ref": "#/$defs/ClauseDetail" }
  134. }
  135. },
  136. "additionalProperties": false
  137. },
  138. "ClauseDetail": {
  139. "type": "object",
  140. "required": ["id", "title"],
  141. "properties": {
  142. "id": { "type": "string", "pattern": "^[A-Z][0-9]+(\\.[0-9]+)*$" },
  143. "title": { "type": "string" }
  144. },
  145. "additionalProperties": false
  146. }
  147. },
  148. "additionalProperties": false
  149. }