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

Commit 1f3275e

Browse files
committed
Merge git://github.com/garycourt/json-schema
2 parents 766aca5 + cf45c27 commit 1f3275e

File tree

4 files changed

+479
-236
lines changed

4 files changed

+479
-236
lines changed

draft-04/hyper-schema

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"$schema" : "http://json-schema.org/draft-04/hyper-schema#",
3+
"extends" : {"$ref" : "http://json-schema.org/draft-04/schema#"},
4+
"id" : "http://json-schema.org/draft-04/hyper-schema#",
5+
6+
"properties" : {
7+
"links" : {
8+
"type" : "array",
9+
"items" : {"$ref" : "http://json-schema.org/draft-04/links#"}
10+
},
11+
12+
"fragmentResolution" : {
13+
"type" : "string",
14+
"default" : "json-pointer"
15+
},
16+
17+
"root" : {
18+
"type" : "boolean",
19+
"default" : false
20+
},
21+
22+
"readonly" : {
23+
"type" : "boolean",
24+
"default" : false
25+
},
26+
27+
"contentEncoding" : {
28+
"type" : "string"
29+
},
30+
31+
"pathStart" : {
32+
"type" : "string",
33+
"format" : "uri"
34+
},
35+
36+
"mediaType" : {
37+
"type" : "string",
38+
"format" : "media-type"
39+
}
40+
},
41+
42+
"links" : [
43+
{
44+
"href" : "{id}",
45+
"rel" : "self"
46+
},
47+
48+
{
49+
"href" : "{$ref}",
50+
"rel" : "full"
51+
},
52+
53+
{
54+
"href" : "{$schema}",
55+
"rel" : "describedby"
56+
}
57+
],
58+
59+
"fragmentResolution" : "json-pointer"
60+
}

draft-04/links

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema" : "http://json-schema.org/draft-04/hyper-schema#",
3+
"id" : "http://json-schema.org/draft-04/links#",
4+
"type" : "object",
5+
6+
"properties" : {
7+
"rel" : {
8+
"type" : "string"
9+
},
10+
11+
"href" : {
12+
"type" : "string"
13+
},
14+
15+
"template" : {
16+
"type" : "string"
17+
},
18+
19+
"targetSchema" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"},
20+
21+
"method" : {
22+
"type" : "string",
23+
"default" : "GET"
24+
},
25+
26+
"enctype" : {
27+
"type" : "string"
28+
},
29+
30+
"properties" : {
31+
"type" : "object",
32+
"additionalProperties" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"}
33+
}
34+
},
35+
36+
"required" : ["rel", "href"],
37+
38+
"dependencies" : {
39+
"enctype" : "method"
40+
}
41+
}

draft-04/schema

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
{
2+
"$schema" : "http://json-schema.org/draft-04/schema#",
3+
"id" : "http://json-schema.org/draft-04/schema#",
4+
"type" : "object",
5+
6+
"properties" : {
7+
"type" : {
8+
"type" : [
9+
{
10+
"id" : "#simple-type",
11+
"type" : "string",
12+
"enum" : ["object", "array", "string", "number", "boolean", "null", "any"]
13+
},
14+
"array"
15+
],
16+
"items" : {
17+
"type" : [
18+
{"$ref" : "#simple-type"},
19+
{"$ref" : "#"}
20+
]
21+
},
22+
"uniqueItems" : true,
23+
"default" : "any"
24+
},
25+
26+
"disallow" : {
27+
"type" : ["string", "array"],
28+
"items" : {
29+
"type" : ["string", {"$ref" : "#"}]
30+
},
31+
"uniqueItems" : true
32+
},
33+
34+
"extends" : {
35+
"type" : [{"$ref" : "#"}, "array"],
36+
"items" : {"$ref" : "#"},
37+
"default" : {}
38+
},
39+
40+
"enum" : {
41+
"type" : "array",
42+
"minItems" : 1,
43+
"uniqueItems" : true
44+
},
45+
46+
"minimum" : {
47+
"type" : "number"
48+
},
49+
50+
"maximum" : {
51+
"type" : "number"
52+
},
53+
54+
"exclusiveMinimum" : {
55+
"type" : "boolean",
56+
"default" : false
57+
},
58+
59+
"exclusiveMaximum" : {
60+
"type" : "boolean",
61+
"default" : false
62+
},
63+
64+
"divisibleBy" : {
65+
"type" : "number",
66+
"minimum" : 0,
67+
"exclusiveMinimum" : true,
68+
"default" : 1
69+
},
70+
71+
"minLength" : {
72+
"type" : "integer",
73+
"minimum" : 0,
74+
"default" : 0
75+
},
76+
77+
"maxLength" : {
78+
"type" : "integer"
79+
},
80+
81+
"pattern" : {
82+
"type" : "string"
83+
},
84+
85+
"items" : {
86+
"type" : [{"$ref" : "#"}, "array"],
87+
"items" : {"$ref" : "#"},
88+
"default" : {}
89+
},
90+
91+
"additionalItems" : {
92+
"type" : [{"$ref" : "#"}, "boolean"],
93+
"default" : {}
94+
},
95+
96+
"minItems" : {
97+
"type" : "integer",
98+
"minimum" : 0,
99+
"default" : 0
100+
},
101+
102+
"maxItems" : {
103+
"type" : "integer",
104+
"minimum" : 0
105+
},
106+
107+
"uniqueItems" : {
108+
"type" : "boolean",
109+
"default" : false
110+
},
111+
112+
"properties" : {
113+
"type" : "object",
114+
"additionalProperties" : {"$ref" : "#"},
115+
"default" : {}
116+
},
117+
118+
"patternProperties" : {
119+
"type" : "object",
120+
"additionalProperties" : {"$ref" : "#"},
121+
"default" : {}
122+
},
123+
124+
"additionalProperties" : {
125+
"type" : [{"$ref" : "#"}, "boolean"],
126+
"default" : {}
127+
},
128+
129+
"minProperties" : {
130+
"type" : "integer",
131+
"minimum" : 0,
132+
"default" : 0
133+
},
134+
135+
"maxProperties" : {
136+
"type" : "integer",
137+
"minimum" : 0
138+
},
139+
140+
"required" : {
141+
"type" : "array",
142+
"items" : {
143+
"type" : "string"
144+
}
145+
},
146+
147+
"dependencies" : {
148+
"type" : "object",
149+
"additionalProperties" : {
150+
"type" : ["string", "array", {"$ref" : "#"}],
151+
"items" : {
152+
"type" : "string"
153+
}
154+
},
155+
"default" : {}
156+
},
157+
158+
"id" : {
159+
"type" : "string"
160+
},
161+
162+
"$ref" : {
163+
"type" : "string"
164+
},
165+
166+
"$schema" : {
167+
"type" : "string"
168+
},
169+
170+
"title" : {
171+
"type" : "string"
172+
},
173+
174+
"description" : {
175+
"type" : "string"
176+
},
177+
178+
"default" : {
179+
"type" : "any"
180+
}
181+
},
182+
183+
"dependencies" : {
184+
"exclusiveMinimum" : "minimum",
185+
"exclusiveMaximum" : "maximum"
186+
},
187+
188+
"default" : {}
189+
}

0 commit comments

Comments
 (0)