Skip to content

Commit b206aea

Browse files
committed
Standardize meta-schema formatting.
* Remove "#" from "$schema" as it MUST be an absolute URI. * Use the formatting style from schema.json * Use the "$schema"/"id" and a root "title" rather than "description" in schema.json to match hyper-schema.json and links.json * Restore the links meta-schema
1 parent f36d132 commit b206aea

File tree

3 files changed

+66
-41
lines changed

3 files changed

+66
-41
lines changed

hyper-schema.json

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,67 @@
11
{
2-
"$schema": "http://json-schema.org/draft/hyper-schema#",
3-
"id": "http://json-schema.org/draft/hyper-schema#",
2+
"$schema": "http://json-schema.org/draft/hyper-schema",
3+
"id": "http://json-schema.org/draft/hyper-schema",
44
"title": "JSON Hyper-Schema",
55
"allOf": [
6-
{"$ref": "http://json-schema.org/draft-04/schema#"}
6+
{
7+
"$ref": "http://json-schema.org/draft/schema"
8+
}
79
],
810
"properties": {
911
"additionalItems": {
1012
"anyOf": [
11-
{"type": "boolean"},
12-
{"$ref": "#"}
13+
{ "type": "boolean" },
14+
{ "$ref": "#" }
1315
]
1416
},
1517
"additionalProperties": {
1618
"anyOf": [
17-
{"type": "boolean"},
18-
{"$ref": "#"}
19+
{ "type": "boolean" },
20+
{ "$ref": "#" }
1921
]
2022
},
2123
"dependencies": {
2224
"additionalProperties": {
2325
"anyOf": [
24-
{"$ref": "#"},
25-
{"type": "array"}
26+
{ "$ref": "#" },
27+
{ "type": "array" }
2628
]
2729
}
2830
},
2931
"items": {
3032
"anyOf": [
31-
{"$ref": "#"},
32-
{"$ref": "#/definitions/schemaArray"}
33+
{ "$ref": "#" },
34+
{ "$ref": "#/definitions/schemaArray" }
3335
]
3436
},
3537
"definitions": {
36-
"additionalProperties": {"$ref": "#"}
38+
"additionalProperties": { "$ref": "#" }
3739
},
3840
"patternProperties": {
39-
"additionalProperties": {"$ref": "#"}
41+
"additionalProperties": { "$ref": "#" }
4042
},
4143
"properties": {
42-
"additionalProperties": {"$ref": "#"}
44+
"additionalProperties": { "$ref": "#" }
4345
},
44-
"allOf": {"$ref": "#/definitions/schemaArray"},
45-
"anyOf": {"$ref": "#/definitions/schemaArray"},
46-
"oneOf": {"$ref": "#/definitions/schemaArray"},
46+
"allOf": { "$ref": "#/definitions/schemaArray" },
47+
"anyOf": { "$ref": "#/definitions/schemaArray" },
48+
"oneOf": { "$ref": "#/definitions/schemaArray" },
4749
"not": { "$ref": "#" },
4850

4951
"base": {
50-
"description": "URI Template resolved as for the 'href' keyword in the Link Description Object. The resulting URI Reference is resolved against the current URI base and sets the new URI base for URI references within the instance.",
5152
"type": "string"
5253
},
5354
"links": {
5455
"type": "array",
55-
"items": {"$ref": "#/definitions/linkDescription"}
56+
"items": { "$ref": "#/definitions/linkDescription" }
5657
},
5758
"media": {
5859
"type": "object",
5960
"properties": {
6061
"type": {
61-
"description": "A media type, as described in RFC 2046",
6262
"type": "string"
6363
},
6464
"binaryEncoding": {
65-
"description": "A content encoding scheme, as described in RFC 2045",
6665
"type": "string"
6766
}
6867
}
@@ -71,46 +70,34 @@
7170
"definitions": {
7271
"schemaArray": {
7372
"type": "array",
74-
"items": {"$ref": "#"}
73+
"items": { "$ref": "#" }
7574
},
7675
"linkDescription": {
7776
"title": "Link Description Object",
7877
"type": "object",
79-
"required": ["href"],
78+
"required": [ "href" ],
8079
"properties": {
8180
"href": {
82-
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
8381
"type": "string"
8482
},
8583
"rel": {
86-
"description": "relation to the target resource of the link",
8784
"type": "string"
8885
},
8986
"title": {
90-
"description": "a title for the link",
9187
"type": "string"
9288
},
93-
"targetSchema": {
94-
"description": "JSON Schema describing the link target",
95-
"$ref": "#"
96-
},
89+
"targetSchema": { "$ref": "#" },
9790
"mediaType": {
98-
"description": "media type (as defined by RFC 2046) describing the link target",
9991
"type": "string"
10092
},
10193
"method": {
102-
"description": "specifies that the client can construct a templated query (\"get\") or non-idempotent request (\"post\") to a resource.",
10394
"type": "string"
10495
},
10596
"encType": {
106-
"description": "The media type in which to submit data along with the request",
10797
"type": "string",
10898
"default": "application/json"
10999
},
110-
"schema": {
111-
"description": "Schema describing the data to submit along with the request",
112-
"$ref": "#"
113-
}
100+
"schema": { "$ref": "#" }
114101
}
115102
}
116103
},

links.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "http://json-schema.org/draft/hyper-schema",
3+
"id": "http://json-schema.org/draft/links",
4+
"title": "Link Description Object",
5+
"type": "object",
6+
"required": [ "href" ],
7+
"properties": {
8+
"href": {
9+
"type": "string"
10+
},
11+
"rel": {
12+
"type": "string"
13+
},
14+
"title": {
15+
"type": "string"
16+
},
17+
"targetSchema": { "$ref": "hyper-schema" },
18+
"mediaType": {
19+
"type": "string"
20+
},
21+
"method": {
22+
"type": "string"
23+
},
24+
"encType": {
25+
"type": "string",
26+
"default": "application/json"
27+
},
28+
"schema": { "$ref": "hyper-schema" }
29+
}
30+
}

schema.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"id": "http://json-schema.org/draft/schema#",
3-
"$schema": "http://json-schema.org/draft/schema#",
4-
"description": "Core schema meta-schema",
2+
"$schema": "http://json-schema.org/draft/schema",
3+
"id": "http://json-schema.org/draft/schema",
4+
"title": "Core schema meta-schema",
55
"definitions": {
66
"schemaArray": {
77
"type": "array",
@@ -19,7 +19,15 @@
1919
]
2020
},
2121
"simpleTypes": {
22-
"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+
]
2331
},
2432
"stringArray": {
2533
"type": "array",

0 commit comments

Comments
 (0)