You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
4.3 KiB

  1. {
  2. "id": "http://json-schema.org/draft-04/schema#",
  3. "$schema": "http://json-schema.org/draft-04/schema#",
  4. "description": "Core schema meta-schema",
  5. "definitions": {
  6. "schemaArray": {
  7. "type": "array",
  8. "minItems": 1,
  9. "items": { "$ref": "#" }
  10. },
  11. "positiveInteger": {
  12. "type": "integer",
  13. "minimum": 0
  14. },
  15. "positiveIntegerDefault0": {
  16. "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
  17. },
  18. "simpleTypes": {
  19. "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
  20. },
  21. "stringArray": {
  22. "type": "array",
  23. "items": { "type": "string" },
  24. "minItems": 1,
  25. "uniqueItems": true
  26. }
  27. },
  28. "type": "object",
  29. "properties": {
  30. "id": {
  31. "type": "string"
  32. },
  33. "$schema": {
  34. "type": "string"
  35. },
  36. "title": {
  37. "type": "string"
  38. },
  39. "description": {
  40. "type": "string"
  41. },
  42. "default": {},
  43. "multipleOf": {
  44. "type": "number",
  45. "minimum": 0,
  46. "exclusiveMinimum": true
  47. },
  48. "maximum": {
  49. "type": "number"
  50. },
  51. "exclusiveMaximum": {
  52. "type": "boolean",
  53. "default": false
  54. },
  55. "minimum": {
  56. "type": "number"
  57. },
  58. "exclusiveMinimum": {
  59. "type": "boolean",
  60. "default": false
  61. },
  62. "maxLength": { "$ref": "#/definitions/positiveInteger" },
  63. "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
  64. "pattern": {
  65. "type": "string",
  66. "format": "regex"
  67. },
  68. "additionalItems": {
  69. "anyOf": [
  70. { "type": "boolean" },
  71. { "$ref": "#" }
  72. ],
  73. "default": {}
  74. },
  75. "items": {
  76. "anyOf": [
  77. { "$ref": "#" },
  78. { "$ref": "#/definitions/schemaArray" }
  79. ],
  80. "default": {}
  81. },
  82. "maxItems": { "$ref": "#/definitions/positiveInteger" },
  83. "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
  84. "uniqueItems": {
  85. "type": "boolean",
  86. "default": false
  87. },
  88. "maxProperties": { "$ref": "#/definitions/positiveInteger" },
  89. "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
  90. "required": { "$ref": "#/definitions/stringArray" },
  91. "additionalProperties": {
  92. "anyOf": [
  93. { "type": "boolean" },
  94. { "$ref": "#" }
  95. ],
  96. "default": {}
  97. },
  98. "definitions": {
  99. "type": "object",
  100. "additionalProperties": { "$ref": "#" },
  101. "default": {}
  102. },
  103. "properties": {
  104. "type": "object",
  105. "additionalProperties": { "$ref": "#" },
  106. "default": {}
  107. },
  108. "patternProperties": {
  109. "type": "object",
  110. "additionalProperties": { "$ref": "#" },
  111. "default": {}
  112. },
  113. "dependencies": {
  114. "type": "object",
  115. "additionalProperties": {
  116. "anyOf": [
  117. { "$ref": "#" },
  118. { "$ref": "#/definitions/stringArray" }
  119. ]
  120. }
  121. },
  122. "enum": {
  123. "type": "array",
  124. "minItems": 1,
  125. "uniqueItems": true
  126. },
  127. "type": {
  128. "anyOf": [
  129. { "$ref": "#/definitions/simpleTypes" },
  130. {
  131. "type": "array",
  132. "items": { "$ref": "#/definitions/simpleTypes" },
  133. "minItems": 1,
  134. "uniqueItems": true
  135. }
  136. ]
  137. },
  138. "format": { "type": "string" },
  139. "allOf": { "$ref": "#/definitions/schemaArray" },
  140. "anyOf": { "$ref": "#/definitions/schemaArray" },
  141. "oneOf": { "$ref": "#/definitions/schemaArray" },
  142. "not": { "$ref": "#" }
  143. },
  144. "dependencies": {
  145. "exclusiveMaximum": [ "maximum" ],
  146. "exclusiveMinimum": [ "minimum" ]
  147. },
  148. "default": {}
  149. }