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

Commit 899ee61

Browse files
authored
Merge pull request #103 from handrews/latest
Update "latest" meta-schemas to draft-06
2 parents 3c5995a + 1eee42e commit 899ee61

File tree

3 files changed

+134
-170
lines changed

3 files changed

+134
-170
lines changed

hyper-schema

+78-115
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,107 @@
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-06/hyper-schema#",
3+
"$id": "http://json-schema.org/draft-06/hyper-schema#",
44
"title": "JSON Hyper-Schema",
5-
"allOf": [
6-
{
7-
"$ref": "http://json-schema.org/draft-04/schema#"
5+
"definitions": {
6+
"schemaArray": {
7+
"allOf": [
8+
{ "$ref": "http://json-schema.org/draft-06/schema#/definitions/schemaArray" },
9+
{
10+
"items": { "$ref": "#" }
11+
}
12+
]
13+
},
14+
"linkDescription": {
15+
"title": "Link Description Object",
16+
"type": "object",
17+
"required": [ "href" ],
18+
"properties": {
19+
"href": {
20+
"description": "a URI template, as defined by RFC 6570",
21+
"type": "string",
22+
"format": "uri-template"
23+
},
24+
"hrefSchema": {
25+
"description": "a schema for validating user input to the URI template, where the input is in the form of a JSON object with property names matching variable names in \"href\"",
26+
"allOf": [ {"$ref": "#"} ]
27+
},
28+
"rel": {
29+
"description": "relation to the target resource of the link",
30+
"type": "string"
31+
},
32+
"title": {
33+
"description": "a title for the link",
34+
"type": "string"
35+
},
36+
"targetSchema": {
37+
"description": "JSON Schema describing the link target",
38+
"allOf": [ { "$ref": "#" } ]
39+
},
40+
"mediaType": {
41+
"description": "media type (as defined by RFC 2046) describing the link target",
42+
"type": "string"
43+
},
44+
"submissionEncType": {
45+
"description": "The media type in which to submit data along with the request",
46+
"type": "string",
47+
"default": "application/json"
48+
},
49+
"submissionSchema": {
50+
"description": "Schema describing the data to submit along with the request",
51+
"allOf": [ { "$ref": "#" } ]
52+
}
53+
}
854
}
9-
],
55+
},
56+
"allOf": [ { "$ref": "http://json-schema.org/draft-06/schema#" } ],
1057
"properties": {
1158
"additionalItems": {
1259
"anyOf": [
13-
{
14-
"type": "boolean"
15-
},
16-
{
17-
"$ref": "#"
18-
}
60+
{ "type": "boolean" },
61+
{ "$ref": "#" }
1962
]
2063
},
2164
"additionalProperties": {
2265
"anyOf": [
23-
{
24-
"type": "boolean"
25-
},
26-
{
27-
"$ref": "#"
28-
}
66+
{ "type": "boolean" },
67+
{ "$ref": "#" }
2968
]
3069
},
3170
"dependencies": {
3271
"additionalProperties": {
3372
"anyOf": [
34-
{
35-
"$ref": "#"
36-
},
37-
{
38-
"type": "array"
39-
}
73+
{ "$ref": "#" },
74+
{ "type": "array" }
4075
]
4176
}
4277
},
4378
"items": {
4479
"anyOf": [
45-
{
46-
"$ref": "#"
47-
},
48-
{
49-
"$ref": "#/definitions/schemaArray"
50-
}
80+
{ "$ref": "#" },
81+
{ "$ref": "#/definitions/schemaArray" }
5182
]
5283
},
5384
"definitions": {
54-
"additionalProperties": {
55-
"$ref": "#"
56-
}
85+
"additionalProperties": { "$ref": "#" }
5786
},
5887
"patternProperties": {
59-
"additionalProperties": {
60-
"$ref": "#"
61-
}
88+
"additionalProperties": { "$ref": "#" }
6289
},
6390
"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": "#"
91+
"additionalProperties": { "$ref": "#" }
7992
},
93+
"allOf": { "$ref": "#/definitions/schemaArray" },
94+
"anyOf": { "$ref": "#/definitions/schemaArray" },
95+
"oneOf": { "$ref": "#/definitions/schemaArray" },
96+
"not": { "$ref": "#" },
8097

98+
"base": {
99+
"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.",
100+
"type": "string"
101+
},
81102
"links": {
82103
"type": "array",
83-
"items": {
84-
"$ref": "#/definitions/linkDescription"
85-
}
86-
},
87-
"fragmentResolution": {
88-
"type": "string"
104+
"items": { "$ref": "#/definitions/linkDescription" }
89105
},
90106
"media": {
91107
"type": "object",
@@ -100,69 +116,16 @@
100116
}
101117
}
102118
},
103-
"pathStart": {
104-
"description": "Instances' URIs must start with this value for this schema to apply to them",
105-
"type": "string",
106-
"format": "uri"
107-
}
108-
},
109-
"definitions": {
110-
"schemaArray": {
111-
"type": "array",
112-
"items": {
113-
"$ref": "#"
114-
}
115-
},
116-
"linkDescription": {
117-
"title": "Link Description Object",
118-
"type": "object",
119-
"required": [ "href", "rel" ],
120-
"properties": {
121-
"href": {
122-
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
123-
"type": "string"
124-
},
125-
"rel": {
126-
"description": "relation to the target resource of the link",
127-
"type": "string"
128-
},
129-
"title": {
130-
"description": "a title for the link",
131-
"type": "string"
132-
},
133-
"targetSchema": {
134-
"description": "JSON Schema describing the link target",
135-
"$ref": "#"
136-
},
137-
"mediaType": {
138-
"description": "media type (as defined by RFC 2046) describing the link target",
139-
"type": "string"
140-
},
141-
"method": {
142-
"description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")",
143-
"type": "string"
144-
},
145-
"encType": {
146-
"description": "The media type in which to submit data along with the request",
147-
"type": "string",
148-
"default": "application/json"
149-
},
150-
"schema": {
151-
"description": "Schema describing the data to submit along with the request",
152-
"$ref": "#"
153-
}
154-
}
119+
"readOnly": {
120+
"description": "If true, indicates that the value of this property is controlled by the server.",
121+
"type": "boolean",
122+
"default": "false"
155123
}
156124
},
157125
"links": [
158126
{
159127
"rel": "self",
160-
"href": "{+id}"
161-
},
162-
{
163-
"rel": "full",
164-
"href": "{+($ref)}"
128+
"href": "{+%24id}"
165129
}
166130
]
167131
}
168-

links

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
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-06/hyper-schema#",
3+
"$id": "http://json-schema.org/draft-06/links#",
44
"title": "Link Description Object",
55
"type": "object",
6-
"required": [ "href", "rel" ],
6+
"required": [ "href" ],
77
"properties": {
88
"href": {
9-
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
10-
"type": "string"
9+
"description": "a URI template, as defined by RFC 6570",
10+
"type": "string",
11+
"format": "uri-template"
12+
},
13+
"hrefSchema": {
14+
"description": "a schema for validating user input to the URI template, where the input is in the form of a JSON object with property names matching variable names in \"href\"",
15+
"allOf": [ {"$ref": "#"} ]
1116
},
1217
"rel": {
1318
"description": "relation to the target resource of the link",
@@ -19,24 +24,20 @@
1924
},
2025
"targetSchema": {
2126
"description": "JSON Schema describing the link target",
22-
"$ref": "hyper-schema#"
27+
"allOf": [ { "$ref": "hyper-schema#" } ]
2328
},
2429
"mediaType": {
2530
"description": "media type (as defined by RFC 2046) describing the link target",
2631
"type": "string"
2732
},
28-
"method": {
29-
"description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")",
30-
"type": "string"
31-
},
32-
"encType": {
33+
"submissionEncType": {
3334
"description": "The media type in which to submit data along with the request",
3435
"type": "string",
3536
"default": "application/json"
3637
},
37-
"schema": {
38+
"submissionSchema": {
3839
"description": "Schema describing the data to submit along with the request",
39-
"$ref": "hyper-schema#"
40+
"allOf": [ { "$ref": "hyper-schema#" } ]
4041
}
4142
}
4243
}

0 commit comments

Comments
 (0)