Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit fe6401b

Browse files
committed
Bugfix/formatting changes to meta-schemas.
This change bumps the meta-schema versions to 05, but otherwise only makes obvious bug fixes and formatting consistency changes. Specifically: * $schema MUST be an absolute URI, so the fragment delimter is removed. * To match $schema, the fragment delimiter is also removed from the ids. * Always put $schema first (links and hyper-schema outvoted schema). * Similary, use title rather than description at root of all three. * Descriptions easily get out of sync with the specification, and the core/validation schema does not have them. Remove them from the hyper-schema and links meta-schemas. * Standardize on the core/validation schema style of formatting. * Standardize on "$ref" objects being all on one line. * Restore "format" to the meta-schema.
1 parent 8f39fa9 commit fe6401b

File tree

3 files changed

+43
-92
lines changed

3 files changed

+43
-92
lines changed

draft-05/hyper-schema

Lines changed: 22 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,56 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
3-
"id": "http://json-schema.org/draft-04/hyper-schema#",
2+
"$schema": "http://json-schema.org/draft-05/hyper-schema",
3+
"id": "http://json-schema.org/draft-05/hyper-schema",
44
"title": "JSON Hyper-Schema",
55
"allOf": [
66
{
7-
"$ref": "http://json-schema.org/draft-04/schema#"
7+
"$ref": "http://json-schema.org/draft-05/schema"
88
}
99
],
1010
"properties": {
1111
"additionalItems": {
1212
"anyOf": [
13-
{
14-
"type": "boolean"
15-
},
16-
{
17-
"$ref": "#"
18-
}
13+
{ "type": "boolean" },
14+
{ "$ref": "#" }
1915
]
2016
},
2117
"additionalProperties": {
2218
"anyOf": [
23-
{
24-
"type": "boolean"
25-
},
26-
{
27-
"$ref": "#"
28-
}
19+
{ "type": "boolean" },
20+
{ "$ref": "#" }
2921
]
3022
},
3123
"dependencies": {
3224
"additionalProperties": {
3325
"anyOf": [
34-
{
35-
"$ref": "#"
36-
},
37-
{
38-
"type": "array"
39-
}
26+
{ "$ref": "#" },
27+
{ "type": "array" }
4028
]
4129
}
4230
},
4331
"items": {
4432
"anyOf": [
45-
{
46-
"$ref": "#"
47-
},
48-
{
49-
"$ref": "#/definitions/schemaArray"
50-
}
33+
{ "$ref": "#" },
34+
{ "$ref": "#/definitions/schemaArray" }
5135
]
5236
},
5337
"definitions": {
54-
"additionalProperties": {
55-
"$ref": "#"
56-
}
38+
"additionalProperties": { "$ref": "#" }
5739
},
5840
"patternProperties": {
59-
"additionalProperties": {
60-
"$ref": "#"
61-
}
41+
"additionalProperties": { "$ref": "#" }
6242
},
6343
"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": "#"
44+
"additionalProperties": { "$ref": "#" }
7945
},
46+
"allOf": { "$ref": "#/definitions/schemaArray" },
47+
"anyOf": { "$ref": "#/definitions/schemaArray" },
48+
"oneOf": { "$ref": "#/definitions/schemaArray" },
49+
"not": { "$ref": "#" },
8050

8151
"links": {
8252
"type": "array",
83-
"items": {
84-
"$ref": "#/definitions/linkDescription"
85-
}
53+
"items": { "$ref": "#/definitions/linkDescription" }
8654
},
8755
"fragmentResolution": {
8856
"type": "string"
@@ -91,66 +59,49 @@
9159
"type": "object",
9260
"properties": {
9361
"type": {
94-
"description": "A media type, as described in RFC 2046",
9562
"type": "string"
9663
},
9764
"binaryEncoding": {
98-
"description": "A content encoding scheme, as described in RFC 2045",
9965
"type": "string"
10066
}
10167
}
10268
},
10369
"pathStart": {
104-
"description": "Instances' URIs must start with this value for this schema to apply to them",
10570
"type": "string",
10671
"format": "uri"
10772
}
10873
},
10974
"definitions": {
11075
"schemaArray": {
11176
"type": "array",
112-
"items": {
113-
"$ref": "#"
114-
}
77+
"items": { "$ref": "#" }
11578
},
11679
"linkDescription": {
11780
"title": "Link Description Object",
11881
"type": "object",
11982
"required": [ "href", "rel" ],
12083
"properties": {
12184
"href": {
122-
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
12385
"type": "string"
12486
},
12587
"rel": {
126-
"description": "relation to the target resource of the link",
12788
"type": "string"
12889
},
12990
"title": {
130-
"description": "a title for the link",
13191
"type": "string"
13292
},
133-
"targetSchema": {
134-
"description": "JSON Schema describing the link target",
135-
"$ref": "#"
136-
},
93+
"targetSchema": { "$ref": "#" },
13794
"mediaType": {
138-
"description": "media type (as defined by RFC 2046) describing the link target",
13995
"type": "string"
14096
},
14197
"method": {
142-
"description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")",
14398
"type": "string"
14499
},
145100
"encType": {
146-
"description": "The media type in which to submit data along with the request",
147101
"type": "string",
148102
"default": "application/json"
149103
},
150-
"schema": {
151-
"description": "Schema describing the data to submit along with the request",
152-
"$ref": "#"
153-
}
104+
"schema": { "$ref": "#" }
154105
}
155106
}
156107
}

draft-05/links

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,30 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
3-
"id": "http://json-schema.org/draft-04/links#",
2+
"$schema": "http://json-schema.org/draft-05/hyper-schema",
3+
"id": "http://json-schema.org/draft-05/links",
44
"title": "Link Description Object",
55
"type": "object",
66
"required": [ "href", "rel" ],
77
"properties": {
88
"href": {
9-
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
109
"type": "string"
1110
},
1211
"rel": {
13-
"description": "relation to the target resource of the link",
1412
"type": "string"
1513
},
1614
"title": {
17-
"description": "a title for the link",
1815
"type": "string"
1916
},
20-
"targetSchema": {
21-
"description": "JSON Schema describing the link target",
22-
"$ref": "hyper-schema#"
23-
},
17+
"targetSchema": { "$ref": "hyper-schema" },
2418
"mediaType": {
25-
"description": "media type (as defined by RFC 2046) describing the link target",
2619
"type": "string"
2720
},
2821
"method": {
29-
"description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")",
3022
"type": "string"
3123
},
3224
"encType": {
33-
"description": "The media type in which to submit data along with the request",
3425
"type": "string",
3526
"default": "application/json"
3627
},
37-
"schema": {
38-
"description": "Schema describing the data to submit along with the request",
39-
"$ref": "hyper-schema#"
40-
}
28+
"schema": { "$ref": "hyper-schema" }
4129
}
4230
}

draft-05/schema

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"id": "http://json-schema.org/draft-04/schema#",
3-
"$schema": "http://json-schema.org/draft-04/schema#",
4-
"description": "Core schema meta-schema",
2+
"$schema": "http://json-schema.org/draft-05/schema",
3+
"id": "http://json-schema.org/draft-05/schema",
4+
"title": "Core schema meta-schema",
55
"definitions": {
66
"schemaArray": {
77
"type": "array",
@@ -13,10 +13,21 @@
1313
"minimum": 0
1414
},
1515
"positiveIntegerDefault0": {
16-
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
16+
"allOf": [
17+
{ "$ref": "#/definitions/positiveInteger" },
18+
{ "default": 0 }
19+
]
1720
},
1821
"simpleTypes": {
19-
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
22+
"enum": [
23+
"array",
24+
"boolean",
25+
"integer",
26+
"null",
27+
"number",
28+
"object",
29+
"string"
30+
]
2031
},
2132
"stringArray": {
2233
"type": "array",
@@ -137,6 +148,7 @@
137148
}
138149
]
139150
},
151+
"format": { "type": "string" },
140152
"allOf": { "$ref": "#/definitions/schemaArray" },
141153
"anyOf": { "$ref": "#/definitions/schemaArray" },
142154
"oneOf": { "$ref": "#/definitions/schemaArray" },

0 commit comments

Comments
 (0)