Skip to content

Commit 047826d

Browse files
author
kguillouard
committed
chore: pushed new JSON-Schema
1 parent e27edb8 commit 047826d

File tree

1 file changed

+263
-0
lines changed

1 file changed

+263
-0
lines changed

schema.json

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"default": {
4+
"edges": [],
5+
"nodes": []
6+
},
7+
"properties": {
8+
"required": true,
9+
"edges": {
10+
"items": {
11+
"$ref": "#/definitions/JSONCanvasEdge"
12+
},
13+
"type": "array"
14+
},
15+
"nodes": {
16+
"items": {
17+
"$ref": "#/definitions/JSONCanvasNode"
18+
},
19+
"type": "array"
20+
}
21+
},
22+
"definitions": {
23+
"JSONCanvasColor": {
24+
"anyOf": [
25+
{
26+
"type": "string"
27+
},
28+
{
29+
"$ref": "#/definitions/JSONCanvasColorPreset"
30+
}
31+
]
32+
},
33+
"JSONCanvasColorPreset": {
34+
"enum": [1, 2, 3, 4, 5, 6],
35+
"type": "number"
36+
},
37+
"JSONCanvasEdge": {
38+
"additionalProperties": false,
39+
"properties": {
40+
"color": {
41+
"$ref": "#/definitions/JSONCanvasColor"
42+
},
43+
"fromNode": {
44+
"type": "string"
45+
},
46+
"fromSide": {
47+
"$ref": "#/definitions/JSONCanvasEdgeSide"
48+
},
49+
"id": {
50+
"type": "string"
51+
},
52+
"label": {
53+
"type": "string"
54+
},
55+
"toEnd": {
56+
"$ref": "#/definitions/JSONCanvasEdgeEnd"
57+
},
58+
"toNode": {
59+
"type": "string"
60+
},
61+
"toSide": {
62+
"$ref": "#/definitions/JSONCanvasEdgeSide"
63+
}
64+
},
65+
"required": ["id", "fromNode", "toNode"],
66+
"type": "object"
67+
},
68+
"JSONCanvasEdgeEnd": {
69+
"enum": ["none", "arrow"],
70+
"type": "string"
71+
},
72+
"JSONCanvasEdgeSide": {
73+
"enum": ["top", "right", "bottom", "left"],
74+
"type": "string"
75+
},
76+
"JSONCanvasFileNode": {
77+
"additionalProperties": false,
78+
"properties": {
79+
"color": {
80+
"$ref": "#/definitions/JSONCanvasColor"
81+
},
82+
"file": {
83+
"type": "string"
84+
},
85+
"height": {
86+
"type": "number"
87+
},
88+
"id": {
89+
"type": "string"
90+
},
91+
"subpath": {
92+
"type": "string"
93+
},
94+
"type": {
95+
"const": "file",
96+
"type": "string"
97+
},
98+
"width": {
99+
"type": "number"
100+
},
101+
"x": {
102+
"type": "number"
103+
},
104+
"y": {
105+
"type": "number"
106+
}
107+
},
108+
"required": ["file", "height", "id", "type", "width", "x", "y"],
109+
"type": "object"
110+
},
111+
"JSONCanvasGroupNode": {
112+
"additionalProperties": false,
113+
"properties": {
114+
"background": {
115+
"type": "string"
116+
},
117+
"backgroundStyle": {
118+
"enum": ["cover", "ratio", "repeat"],
119+
"type": "string"
120+
},
121+
"color": {
122+
"$ref": "#/definitions/JSONCanvasColor"
123+
},
124+
"height": {
125+
"type": "number"
126+
},
127+
"id": {
128+
"type": "string"
129+
},
130+
"label": {
131+
"type": "string"
132+
},
133+
"type": {
134+
"const": "group",
135+
"type": "string"
136+
},
137+
"width": {
138+
"type": "number"
139+
},
140+
"x": {
141+
"type": "number"
142+
},
143+
"y": {
144+
"type": "number"
145+
}
146+
},
147+
"required": ["height", "id", "type", "width", "x", "y"],
148+
"type": "object"
149+
},
150+
"JSONCanvasLinkNode": {
151+
"additionalProperties": false,
152+
"properties": {
153+
"color": {
154+
"$ref": "#/definitions/JSONCanvasColor"
155+
},
156+
"height": {
157+
"type": "number"
158+
},
159+
"id": {
160+
"type": "string"
161+
},
162+
"type": {
163+
"const": "link",
164+
"type": "string"
165+
},
166+
"url": {
167+
"type": "string"
168+
},
169+
"width": {
170+
"type": "number"
171+
},
172+
"x": {
173+
"type": "number"
174+
},
175+
"y": {
176+
"type": "number"
177+
}
178+
},
179+
"required": ["height", "id", "type", "url", "width", "x", "y"],
180+
"type": "object"
181+
},
182+
"JSONCanvasNode": {
183+
"anyOf": [
184+
{
185+
"$ref": "#/definitions/JSONCanvasNodeType"
186+
},
187+
{
188+
"$ref": "#/definitions/JSONCanvasTextNode"
189+
},
190+
{
191+
"$ref": "#/definitions/JSONCanvasFileNode"
192+
},
193+
{
194+
"$ref": "#/definitions/JSONCanvasLinkNode"
195+
},
196+
{
197+
"$ref": "#/definitions/JSONCanvasGroupNode"
198+
}
199+
]
200+
},
201+
"JSONCanvasNodeType": {
202+
"additionalProperties": false,
203+
"properties": {
204+
"color": {
205+
"$ref": "#/definitions/JSONCanvasColor"
206+
},
207+
"height": {
208+
"type": "number"
209+
},
210+
"id": {
211+
"type": "string"
212+
},
213+
"type": {
214+
"enum": ["text", "file", "link", "group"],
215+
"type": "string"
216+
},
217+
"width": {
218+
"type": "number"
219+
},
220+
"x": {
221+
"type": "number"
222+
},
223+
"y": {
224+
"type": "number"
225+
}
226+
},
227+
"required": ["id", "type", "x", "y", "width", "height"],
228+
"type": "object"
229+
},
230+
"JSONCanvasTextNode": {
231+
"additionalProperties": false,
232+
"properties": {
233+
"color": {
234+
"$ref": "#/definitions/JSONCanvasColor"
235+
},
236+
"height": {
237+
"type": "number"
238+
},
239+
"id": {
240+
"type": "string"
241+
},
242+
"text": {
243+
"type": "string"
244+
},
245+
"type": {
246+
"const": "text",
247+
"type": "string"
248+
},
249+
"width": {
250+
"type": "number"
251+
},
252+
"x": {
253+
"type": "number"
254+
},
255+
"y": {
256+
"type": "number"
257+
}
258+
},
259+
"required": ["height", "id", "text", "type", "width", "x", "y"],
260+
"type": "object"
261+
}
262+
}
263+
}

0 commit comments

Comments
 (0)