Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

hyper-schema.json 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. {
  2. "$schema": "http://json-schema.org/draft-04/hyper-schema#",
  3. "id": "http://json-schema.org/draft-04/hyper-schema#",
  4. "title": "JSON Hyper-Schema",
  5. "allOf": [
  6. {
  7. "$ref": "http://json-schema.org/draft-04/schema#"
  8. }
  9. ],
  10. "properties": {
  11. "additionalItems": {
  12. "anyOf": [
  13. {
  14. "type": "boolean"
  15. },
  16. {
  17. "$ref": "#"
  18. }
  19. ]
  20. },
  21. "additionalProperties": {
  22. "anyOf": [
  23. {
  24. "type": "boolean"
  25. },
  26. {
  27. "$ref": "#"
  28. }
  29. ]
  30. },
  31. "dependencies": {
  32. "additionalProperties": {
  33. "anyOf": [
  34. {
  35. "$ref": "#"
  36. },
  37. {
  38. "type": "array"
  39. }
  40. ]
  41. }
  42. },
  43. "items": {
  44. "anyOf": [
  45. {
  46. "$ref": "#"
  47. },
  48. {
  49. "$ref": "#/definitions/schemaArray"
  50. }
  51. ]
  52. },
  53. "definitions": {
  54. "additionalProperties": {
  55. "$ref": "#"
  56. }
  57. },
  58. "patternProperties": {
  59. "additionalProperties": {
  60. "$ref": "#"
  61. }
  62. },
  63. "properties": {
  64. "additionalProperties": {
  65. "$ref": "#"
  66. }
  67. },
  68. "allOf": {
  69. "$ref": "#/definitions/schemaArray"
  70. },
  71. "anyOf": {
  72. "$ref": "#/definitions/schemaArray"
  73. },
  74. "oneOf": {
  75. "$ref": "#/definitions/schemaArray"
  76. },
  77. "not": {
  78. "$ref": "#"
  79. },
  80. "links": {
  81. "type": "array",
  82. "items": {
  83. "$ref": "#/definitions/linkDescription"
  84. }
  85. },
  86. "fragmentResolution": {
  87. "type": "string"
  88. },
  89. "media": {
  90. "type": "object",
  91. "properties": {
  92. "type": {
  93. "description": "A media type, as described in RFC 2046",
  94. "type": "string"
  95. },
  96. "binaryEncoding": {
  97. "description": "A content encoding scheme, as described in RFC 2045",
  98. "type": "string"
  99. }
  100. }
  101. },
  102. "pathStart": {
  103. "description": "Instances' URIs must start with this value for this schema to apply to them",
  104. "type": "string",
  105. "format": "uri"
  106. }
  107. },
  108. "definitions": {
  109. "schemaArray": {
  110. "type": "array",
  111. "items": {
  112. "$ref": "#"
  113. }
  114. },
  115. "linkDescription": {
  116. "title": "Link Description Object",
  117. "type": "object",
  118. "required": [ "href", "rel" ],
  119. "properties": {
  120. "href": {
  121. "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
  122. "type": "string"
  123. },
  124. "rel": {
  125. "description": "relation to the target resource of the link",
  126. "type": "string"
  127. },
  128. "title": {
  129. "description": "a title for the link",
  130. "type": "string"
  131. },
  132. "targetSchema": {
  133. "description": "JSON Schema describing the link target",
  134. "$ref": "#"
  135. },
  136. "mediaType": {
  137. "description": "media type (as defined by RFC 2046) describing the link target",
  138. "type": "string"
  139. },
  140. "method": {
  141. "description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")",
  142. "type": "string"
  143. },
  144. "encType": {
  145. "description": "The media type in which to submit data along with the request",
  146. "type": "string",
  147. "default": "application/json"
  148. },
  149. "schema": {
  150. "description": "Schema describing the data to submit along with the request",
  151. "$ref": "#"
  152. }
  153. }
  154. }
  155. },
  156. "links": [
  157. {
  158. "rel": "self",
  159. "href": "{+id}"
  160. },
  161. {
  162. "rel": "full",
  163. "href": "{+($ref)}"
  164. }
  165. ]
  166. }