Skip to content

Commit 117c05e

Browse files
committed
Add dialect schema for hyperschema 2019-09 with schema 2020-12
1 parent 0e08f03 commit 117c05e

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed

hyper-schema.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/hyper-schema",
3+
"$id": "https://json-schema.org/draft/2020-12/hyper-schema",
4+
"$vocabulary": {
5+
"https://json-schema.org/draft/2020-12/vocab/core": true,
6+
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
7+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
8+
"https://json-schema.org/draft/2020-12/vocab/validation": true,
9+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
10+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
11+
"https://json-schema.org/draft/2020-12/vocab/content": true,
12+
"https://json-schema.org/draft/2019-09/vocab/hyper-schema": true
13+
},
14+
"$dynamicAnchor": "meta",
15+
16+
"title": "JSON Hyper-Schema",
17+
"allOf": [
18+
{ "$ref": "https://json-schema.org/draft/2020-12/schema" },
19+
{ "$ref": "https://json-schema.org/draft/2020-12/meta/hyper-schema" }
20+
],
21+
"links": [
22+
{
23+
"rel": "self",
24+
"href": "{+%24id}"
25+
}
26+
]
27+
}

links.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://json-schema.org/draft/2020-12/links",
4+
"title": "Link Description Object",
5+
6+
"type": "object",
7+
"properties": {
8+
"anchor": {
9+
"type": "string",
10+
"format": "uri-template"
11+
},
12+
"anchorPointer": {
13+
"type": "string",
14+
"anyOf": [
15+
{ "format": "json-pointer" },
16+
{ "format": "relative-json-pointer" }
17+
]
18+
},
19+
"rel": {
20+
"anyOf": [
21+
{ "type": "string" },
22+
{
23+
"type": "array",
24+
"items": { "type": "string" },
25+
"minItems": 1
26+
}
27+
]
28+
},
29+
"href": {
30+
"type": "string",
31+
"format": "uri-template"
32+
},
33+
"hrefSchema": {
34+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
35+
"default": false
36+
},
37+
"templatePointers": {
38+
"type": "object",
39+
"additionalProperties": {
40+
"type": "string",
41+
"anyOf": [
42+
{ "format": "json-pointer" },
43+
{ "format": "relative-json-pointer" }
44+
]
45+
}
46+
},
47+
"templateRequired": {
48+
"type": "array",
49+
"items": {
50+
"type": "string"
51+
},
52+
"uniqueItems": true
53+
},
54+
"title": {
55+
"type": "string"
56+
},
57+
"description": {
58+
"type": "string"
59+
},
60+
"targetSchema": {
61+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
62+
"default": true
63+
},
64+
"targetMediaType": {
65+
"type": "string"
66+
},
67+
"targetHints": {},
68+
"headerSchema": {
69+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
70+
"default": true
71+
},
72+
"submissionMediaType": {
73+
"type": "string",
74+
"default": "application/json"
75+
},
76+
"submissionSchema": {
77+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
78+
"default": true
79+
},
80+
"$comment": {
81+
"type": "string"
82+
}
83+
},
84+
"required": [ "rel", "href" ]
85+
}

meta/hyper-schema.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/hyper-schema",
3+
"$id": "https://json-schema.org/draft/2020-12/meta/hyper-schema",
4+
"$vocabulary": {
5+
"https://json-schema.org/draft/2019-09/vocab/hyper-schema": true
6+
},
7+
"$dynamicAnchor": "meta",
8+
9+
"title": "JSON Hyper-Schema Vocabulary Schema",
10+
"type": ["object", "boolean"],
11+
"properties": {
12+
"base": {
13+
"type": "string",
14+
"format": "uri-template"
15+
},
16+
"links": {
17+
"type": "array",
18+
"items": {
19+
"$ref": "https://json-schema.org/draft/2020-12/links"
20+
}
21+
}
22+
},
23+
"links": [
24+
{
25+
"rel": "self",
26+
"href": "{+%24id}"
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)