Skip to content

Commit f35613b

Browse files
committed
Update to the latest drafts/meta-schemas.
These were copied from the draft-wright-json-schema-00 tag in the json-schema-org/json-schema-spec repository. Addresses issue json-schema-org#38. Also remove "links" as it was part of older drafts and is no longer a separate meta-schema.
1 parent e0cf04e commit f35613b

9 files changed

+3040
-4615
lines changed

documentation.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
<h2>Specification</h2>
66
<div class="block">
7-
<p>The latest IETF published draft is v4. The specification is split into three parts:
7+
<p>The latest IETF published draft is v5, although due to a change in authorship
8+
the I-D numbering has been reset to 00. The specification is split into three parts:
89

910
<p>
1011
<table class="key-value">
@@ -22,7 +23,7 @@ <h2>Specification</h2>
2223
</tr>
2324
</table>
2425

25-
<p>They are also available on the IETF main site: <a href="http://tools.ietf.org/html/draft-zyp-json-schema-04">core</a>, <a href="http://tools.ietf.org/html/draft-fge-json-schema-validation-00">validation</a> and <a href="http://tools.ietf.org/html/draft-luff-json-hyper-schema-00">hyper-schema</a>.
26+
<p>They are also available on the IETF main site: <a href="http://tools.ietf.org/html/draft-wright-json-schema-00">core</a>, <a href="http://tools.ietf.org/html/draft-wright-json-schema-validation-00">validation</a> and <a href="http://tools.ietf.org/html/draft-wright-json-schema-hyperschema-00">hyper-schema</a>.
2627
</div>
2728

2829
<h2>Meta-schemas</h2>

draft-wright-00/hyper-schema

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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+
{"$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": "#" },
48+
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+
}

draft-wright-00/schema

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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+
"format": "uri"
33+
},
34+
"$schema": {
35+
"type": "string",
36+
"format": "uri"
37+
},
38+
"title": {
39+
"type": "string"
40+
},
41+
"description": {
42+
"type": "string"
43+
},
44+
"default": {},
45+
"multipleOf": {
46+
"type": "number",
47+
"minimum": 0,
48+
"exclusiveMinimum": true
49+
},
50+
"maximum": {
51+
"type": "number"
52+
},
53+
"exclusiveMaximum": {
54+
"type": "boolean",
55+
"default": false
56+
},
57+
"minimum": {
58+
"type": "number"
59+
},
60+
"exclusiveMinimum": {
61+
"type": "boolean",
62+
"default": false
63+
},
64+
"maxLength": { "$ref": "#/definitions/positiveInteger" },
65+
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
66+
"pattern": {
67+
"type": "string",
68+
"format": "regex"
69+
},
70+
"additionalItems": {
71+
"anyOf": [
72+
{ "type": "boolean" },
73+
{ "$ref": "#" }
74+
],
75+
"default": {}
76+
},
77+
"items": {
78+
"anyOf": [
79+
{ "$ref": "#" },
80+
{ "$ref": "#/definitions/schemaArray" }
81+
],
82+
"default": {}
83+
},
84+
"maxItems": { "$ref": "#/definitions/positiveInteger" },
85+
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
86+
"uniqueItems": {
87+
"type": "boolean",
88+
"default": false
89+
},
90+
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
91+
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
92+
"required": { "$ref": "#/definitions/stringArray" },
93+
"additionalProperties": {
94+
"anyOf": [
95+
{ "type": "boolean" },
96+
{ "$ref": "#" }
97+
],
98+
"default": {}
99+
},
100+
"definitions": {
101+
"type": "object",
102+
"additionalProperties": { "$ref": "#" },
103+
"default": {}
104+
},
105+
"properties": {
106+
"type": "object",
107+
"additionalProperties": { "$ref": "#" },
108+
"default": {}
109+
},
110+
"patternProperties": {
111+
"type": "object",
112+
"additionalProperties": { "$ref": "#" },
113+
"default": {}
114+
},
115+
"dependencies": {
116+
"type": "object",
117+
"additionalProperties": {
118+
"anyOf": [
119+
{ "$ref": "#" },
120+
{ "$ref": "#/definitions/stringArray" }
121+
]
122+
}
123+
},
124+
"enum": {
125+
"type": "array",
126+
"minItems": 1,
127+
"uniqueItems": true
128+
},
129+
"type": {
130+
"anyOf": [
131+
{ "$ref": "#/definitions/simpleTypes" },
132+
{
133+
"type": "array",
134+
"items": { "$ref": "#/definitions/simpleTypes" },
135+
"minItems": 1,
136+
"uniqueItems": true
137+
}
138+
]
139+
},
140+
"format": { "type": "string" },
141+
"allOf": { "$ref": "#/definitions/schemaArray" },
142+
"anyOf": { "$ref": "#/definitions/schemaArray" },
143+
"oneOf": { "$ref": "#/definitions/schemaArray" },
144+
"not": { "$ref": "#" }
145+
},
146+
"dependencies": {
147+
"exclusiveMaximum": [ "maximum" ],
148+
"exclusiveMinimum": [ "minimum" ]
149+
},
150+
"default": {}
151+
}

0 commit comments

Comments
 (0)