Skip to content

Commit d4c5b3a

Browse files
committed
Draft 04:
- draft-zyp-json-schema-04 - draft-fge-json-schema-validation-00 - draft-luff-json-hyper-schema-00
2 parents d6eadbd + 7f5ecac commit d4c5b3a

8 files changed

+3546
-1284
lines changed

hyper-schema.json

+129-58
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,131 @@
11
{
2-
"$schema" : "http://json-schema.org/draft-03/hyper-schema#",
3-
"extends" : {"$ref" : "http://json-schema.org/draft-03/schema#"}
4-
"id" : "http://json-schema.org/draft-03/hyper-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+
],
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": "#" },
548

6-
"properties" : {
7-
"links" : {
8-
"type" : "array",
9-
"items" : {"$ref" : "http://json-schema.org/draft-03/links#"}
10-
},
11-
12-
"fragmentResolution" : {
13-
"type" : "string",
14-
"default" : "slash-delimited"
15-
},
16-
17-
"root" : {
18-
"type" : "boolean",
19-
"default" : false
20-
},
21-
22-
"readonly" : {
23-
"type" : "boolean",
24-
"default" : false
25-
},
26-
27-
"contentEncoding" : {
28-
"type" : "string"
29-
},
30-
31-
"pathStart" : {
32-
"type" : "string",
33-
"format" : "uri"
34-
},
35-
36-
"mediaType" : {
37-
"type" : "string",
38-
"format" : "media-type"
39-
}
40-
},
41-
42-
"links" : [
43-
{
44-
"href" : "{id}",
45-
"rel" : "self"
46-
},
47-
48-
{
49-
"href" : "{$ref}",
50-
"rel" : "full"
51-
},
52-
53-
{
54-
"href" : "{$schema}",
55-
"rel" : "describedby"
56-
}
57-
],
58-
59-
"fragmentResolution" : "slash-delimited"
60-
}
49+
"links": {
50+
"type": "array",
51+
"items": {"$ref": "#/definitions/linkDescription"}
52+
},
53+
"fragmentResolution": {
54+
"type": "string"
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+
},
69+
"pathStart": {
70+
"description": "Instances' URIs must start with this value for this schema to apply to them",
71+
"type": "string",
72+
"format": "uri"
73+
}
74+
},
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+
}
119+
}
120+
},
121+
"links": [
122+
{
123+
"rel": "self",
124+
"href": "{+id}"
125+
},
126+
{
127+
"rel": "full",
128+
"href": "{+($ref)}"
129+
}
130+
]
131+
}

json-ref.json

-26
This file was deleted.

0 commit comments

Comments
 (0)