json-schema-draft-07.json 4.8 KB

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