|
1 | 1 | {
|
2 |
| - "$schema": "http://json-schema.org/draft-03/hyper-schema#", |
3 |
| - "id": "http://json-schema.org/draft-03/hyper-schema#", |
4 |
| - "extends": { "$ref": "http://json-schema.org/draft-03/schema#" }, |
| 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 | + {"$ref": "http://json-schema.org/draft-04/schema#"} |
| 7 | + ], |
5 | 8 | "properties": {
|
| 9 | + "additionalItems": { |
| 10 | + "anyOf": [ |
| 11 | + {"type": "boolean"}, |
| 12 | + {"$ref": "#"} |
| 13 | + ] |
| 14 | + }, |
| 15 | + "additionalProperties": { |
| 16 | + "anyOf": [ |
| 17 | + {"type": "boolean"}, |
| 18 | + {"$ref": "#"} |
| 19 | + ] |
| 20 | + }, |
| 21 | + "dependencies": { |
| 22 | + "additionalProperties": { |
| 23 | + "anyOf": [ |
| 24 | + {"$ref": "#"}, |
| 25 | + {"type": "array"} |
| 26 | + ] |
| 27 | + } |
| 28 | + }, |
| 29 | + "items": { |
| 30 | + "anyOf": [ |
| 31 | + {"$ref": "#"}, |
| 32 | + {"$ref": "#/definitions/schemaArray"} |
| 33 | + ] |
| 34 | + }, |
| 35 | + "definitions": { |
| 36 | + "additionalProperties": {"$ref": "#"} |
| 37 | + }, |
| 38 | + "patternProperties": { |
| 39 | + "additionalProperties": {"$ref": "#"} |
| 40 | + }, |
| 41 | + "properties": { |
| 42 | + "additionalProperties": {"$ref": "#"} |
| 43 | + }, |
| 44 | + "allOf": {"$ref": "#/definitions/schemaArray"}, |
| 45 | + "anyOf": {"$ref": "#/definitions/schemaArray"}, |
| 46 | + "oneOf": {"$ref": "#/definitions/schemaArray"}, |
| 47 | + "not": { "$ref": "#" }, |
| 48 | + |
6 | 49 | "links": {
|
7 | 50 | "type": "array",
|
8 |
| - "items": { "$ref": "http://json-schema.org/draft-03/links#" } |
| 51 | + "items": {"$ref": "#/definitions/linkDescription"} |
9 | 52 | },
|
10 | 53 | "fragmentResolution": {
|
11 |
| - "type": "string", |
12 |
| - "default": "slash-delimited" |
13 |
| - }, |
14 |
| - "readonly": { |
15 |
| - "type": "boolean", |
16 |
| - "default": false |
17 |
| - }, |
18 |
| - "contentEncoding": { |
19 | 54 | "type": "string"
|
20 | 55 | },
|
| 56 | + "media": { |
| 57 | + "type": "object", |
| 58 | + "properties": { |
| 59 | + "type": { |
| 60 | + "description": "A media type, as described in RFC 2046", |
| 61 | + "type": "string" |
| 62 | + }, |
| 63 | + "binaryEncoding": { |
| 64 | + "description": "A content encoding scheme, as described in RFC 2045", |
| 65 | + "type": "string" |
| 66 | + } |
| 67 | + } |
| 68 | + }, |
21 | 69 | "pathStart": {
|
| 70 | + "description": "Instances' URIs must start with this value for this schema to apply to them", |
22 | 71 | "type": "string",
|
23 | 72 | "format": "uri"
|
24 |
| - }, |
25 |
| - "mediaType": { |
26 |
| - "type": "string", |
27 |
| - "format": "media-type" |
28 | 73 | }
|
29 | 74 | },
|
30 |
| - "links": [ |
31 |
| - { |
32 |
| - "href": "{id}", |
33 |
| - "rel": "self" |
34 |
| - }, |
35 |
| - { |
36 |
| - "href": "{$ref}", |
37 |
| - "rel": "full" |
38 |
| - }, |
39 |
| - { |
40 |
| - "href": "{$schema}", |
41 |
| - "rel": "describedby" |
| 75 | + "definitions": { |
| 76 | + "schemaArray": { |
| 77 | + "type": "array", |
| 78 | + "items": {"$ref": "#"} |
| 79 | + }, |
| 80 | + "linkDescription": { |
| 81 | + "title": "Link Description Object", |
| 82 | + "type": "object", |
| 83 | + "required": ["href", "rel"], |
| 84 | + "properties": { |
| 85 | + "href": { |
| 86 | + "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing", |
| 87 | + "type": "string" |
| 88 | + }, |
| 89 | + "rel": { |
| 90 | + "description": "relation to the target resource of the link", |
| 91 | + "type": "string" |
| 92 | + }, |
| 93 | + "title": { |
| 94 | + "description": "a title for the link", |
| 95 | + "type": "string" |
| 96 | + }, |
| 97 | + "targetSchema": { |
| 98 | + "description": "JSON Schema describing the link target", |
| 99 | + "$ref": "#" |
| 100 | + }, |
| 101 | + "mediaType": { |
| 102 | + "description": "media type (as defined by RFC 2046) describing the link target", |
| 103 | + "type": "string" |
| 104 | + }, |
| 105 | + "method": { |
| 106 | + "description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")", |
| 107 | + "type": "string" |
| 108 | + }, |
| 109 | + "encType": { |
| 110 | + "description": "The media type in which to submit data along with the request", |
| 111 | + "type": "string", |
| 112 | + "default": "application/json" |
| 113 | + }, |
| 114 | + "schema": { |
| 115 | + "description": "Schema describing the data to submit along with the request", |
| 116 | + "$ref": "#" |
| 117 | + } |
| 118 | + } |
42 | 119 | }
|
43 |
| - ], |
44 |
| - "fragmentResolution": "slash-delimited" |
| 120 | + } |
45 | 121 | }
|
0 commit comments