diaspora_federation-json_schema 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: '088ed732f167cfc2a65dbfda5322e02c237a4a68'
4
+ data.tar.gz: b1bb8319b52677da78db4d30707e5e631114cada
5
+ SHA512:
6
+ metadata.gz: a298884b66d9b7638b8694b111a42adeb01fda9179ebd4f381b2f7bc8ed9fca0da17edf2368758cb6d727762640ea829d4bd85572984aca21b46badceec59227
7
+ data.tar.gz: c02ba96478af18ad6a9b04d3aec43f10c3b44b847dd9e12f22a83dc43338a2e80c334f2cc12cf0c7f6d74235338d9092d861648bcdabcc2823cde976d2ba1a48
@@ -0,0 +1,379 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "id": "https://diaspora.github.io/diaspora_federation/schemas/federation_entities.json",
4
+ "oneOf": [
5
+ {"$ref": "#/definitions/comment"},
6
+ {"$ref": "#/definitions/like"},
7
+ {"$ref": "#/definitions/participation"},
8
+ {"$ref": "#/definitions/poll_participation"},
9
+ {"$ref": "#/definitions/status_message"},
10
+ {"$ref": "#/definitions/reshare"},
11
+ {"$ref": "#/definitions/profile"},
12
+ {"$ref": "#/definitions/location"},
13
+ {"$ref": "#/definitions/photo"},
14
+ {"$ref": "#/definitions/poll"},
15
+ {"$ref": "#/definitions/poll_answer"}
16
+ ],
17
+
18
+ "definitions": {
19
+ "signature": {
20
+ "oneOf" : [
21
+ {
22
+ "type": "string",
23
+ "minLength": 30
24
+ },
25
+ {
26
+ "type": "string",
27
+ "maxLength": 0,
28
+ "description": "Allow empty string when no signature is provided"
29
+ }
30
+ ]
31
+ },
32
+
33
+ "guid": {
34
+ "type": "string",
35
+ "minLength": 16,
36
+ "maxLength": 255
37
+ },
38
+
39
+ "relayable": {
40
+ "type": "object",
41
+ "description": "please don't use this object unless you're defining a new child relayable schema",
42
+ "properties": {
43
+ "entity_data": {
44
+ "type": "object",
45
+ "properties": {
46
+ "author": { "type": "string" },
47
+ "guid": { "$ref": "#/definitions/guid" },
48
+ "parent_guid": { "$ref": "#/definitions/guid" },
49
+ "author_signature": { "$ref": "#/definitions/signature" }
50
+ },
51
+ "required": [
52
+ "author", "guid", "parent_guid"
53
+ ]
54
+ },
55
+ "property_order": {
56
+ "type": "array",
57
+ "items": { "type": "string" }
58
+ }
59
+ },
60
+ "required": [
61
+ "entity_data", "entity_type", "property_order"
62
+ ]
63
+ },
64
+
65
+ "comment": {
66
+ "allOf": [
67
+ {"$ref": "#/definitions/relayable"},
68
+ {
69
+ "type": "object",
70
+ "properties": {
71
+ "entity_data": {
72
+ "type": "object",
73
+ "properties": {
74
+ "text": { "type": "string" },
75
+ "created_at": { "type": "string" }
76
+ },
77
+ "required": ["text"]
78
+ },
79
+ "entity_type": {
80
+ "type": "string",
81
+ "pattern": "^comment$"
82
+ }
83
+ }
84
+ }
85
+ ]
86
+ },
87
+
88
+ "like": {
89
+ "allOf": [
90
+ {"$ref": "#/definitions/relayable"},
91
+ {
92
+ "type": "object",
93
+ "properties": {
94
+ "entity_type": {
95
+ "type": "string",
96
+ "pattern": "^like$"
97
+ },
98
+ "entity_data": {
99
+ "type": "object",
100
+ "properties": {
101
+ "positive": { "type": "boolean" },
102
+ "parent_type": { "enum": ["Post", "Comment"] }
103
+ },
104
+ "required": ["positive"]
105
+ }
106
+ }
107
+ }
108
+ ]
109
+ },
110
+
111
+ "participation": {
112
+ "type": "object",
113
+ "properties": {
114
+ "entity_type": {
115
+ "type": "string",
116
+ "pattern": "^participation$"
117
+ },
118
+ "entity_data": {
119
+ "type": "object",
120
+ "properties": {
121
+ "author": { "type": "string" },
122
+ "guid": { "$ref": "#/definitions/guid" },
123
+ "parent_guid": { "$ref": "#/definitions/guid" },
124
+ "parent_type": {"enum": ["Post"]}
125
+ }
126
+ }
127
+ }
128
+ },
129
+
130
+ "poll_participation": {
131
+ "allOf": [
132
+ {"$ref": "#/definitions/relayable"},
133
+ {
134
+ "type": "object",
135
+ "properties": {
136
+ "entity_type": {
137
+ "type": "string",
138
+ "pattern": "^poll_participation$"
139
+ },
140
+ "entity_data": {
141
+ "type": "object",
142
+ "properties": {
143
+ "poll_answer_guid": { "$ref": "#/definitions/guid" }
144
+ },
145
+ "required": ["poll_answer_guid"]
146
+ }
147
+ }
148
+ }
149
+ ]
150
+ },
151
+
152
+ "post": {
153
+ "type": "object",
154
+ "description": "please don't use this object unless you're defining a new child post schema",
155
+ "properties": {
156
+ "entity_data": {
157
+ "type": "object",
158
+ "properties": {
159
+ "guid": { "$ref": "#/definitions/guid" },
160
+ "public": { "type": "boolean" },
161
+ "created_at": { "type": "string" },
162
+ "provider_display_name" : { "type": "string" }
163
+ },
164
+ "required": [
165
+ "guid", "public", "created_at"
166
+ ]
167
+ },
168
+ "required": [
169
+ "entity_type", "entity_data"
170
+ ]
171
+ }
172
+ },
173
+
174
+ "status_message": {
175
+ "allOf": [
176
+ {"$ref": "#/definitions/post"},
177
+ {
178
+ "type": "object",
179
+ "properties": {
180
+ "entity_type": {
181
+ "type": "string",
182
+ "pattern": "^status_message$"
183
+ },
184
+
185
+ "entity_data": {
186
+ "type": "object",
187
+ "properties": {
188
+ "text": { "type": "string" },
189
+
190
+ "location": {
191
+ "oneOf": [
192
+ { "$ref": "#/definitions/location" },
193
+ { "type": "null" }
194
+ ]
195
+ },
196
+
197
+ "poll": {
198
+ "oneOf": [
199
+ { "$ref": "#/definitions/poll" },
200
+ { "type": "null" }
201
+ ]
202
+ },
203
+
204
+ "photos": {
205
+ "type": ["array", "null"],
206
+ "items": { "$ref": "#/definitions/photo" }
207
+ }
208
+ },
209
+
210
+ "required": ["text"]
211
+ }
212
+ }
213
+ }
214
+ ]
215
+ },
216
+
217
+ "reshare": {
218
+ "allOf": [
219
+ {"$ref": "#/definitions/post"},
220
+ {
221
+ "type": "object",
222
+ "properties": {
223
+ "entity_type": {
224
+ "type": "string",
225
+ "pattern": "^reshare$"
226
+ },
227
+
228
+ "entity_data": {
229
+ "type": "object",
230
+ "properties": {
231
+ "root_author": {"type": "string"},
232
+ "root_guid": {"$ref": "#/definitions/guid"}
233
+ },
234
+
235
+ "required": ["root_author", "root_guid"]
236
+ }
237
+ }
238
+ }
239
+ ]
240
+ },
241
+
242
+ "profile": {
243
+ "type": "object",
244
+ "properties": {
245
+ "entity_type": {
246
+ "type": "string",
247
+ "pattern": "^profile$"
248
+ },
249
+ "entity_data": {
250
+ "type": "object",
251
+ "properties": {
252
+ "first_name": { "type": ["string", "null"] },
253
+ "last_name": { "type": ["string", "null"] },
254
+ "gender": { "type": ["string", "null"] },
255
+ "bio": { "type": ["string", "null"] },
256
+ "birthday": { "type": ["string", "null"] },
257
+ "location": { "type": ["string", "null"] },
258
+ "image_url": { "type": ["string", "null"] },
259
+ "author": { "type": "string" }
260
+ },
261
+ "required": [
262
+ "author"
263
+ ]
264
+ }
265
+ },
266
+ "required" :["entity_data", "entity_type"]
267
+ },
268
+
269
+ "photo": {
270
+ "type": "object",
271
+ "properties": {
272
+ "entity_type": {
273
+ "type": "string",
274
+ "pattern": "^photo$"
275
+ },
276
+ "entity_data": {
277
+ "type": "object",
278
+ "properties": {
279
+ "author": { "type": "string" },
280
+ "guid": {"$ref": "#/definitions/guid"},
281
+ "public": {"type": "boolean"},
282
+ "created_at": {"type": "string"},
283
+ "remote_photo_path": {"type": "string"},
284
+ "remote_photo_name": {"type": "string"},
285
+ "text": {"type": ["null", "string"]},
286
+ "status_message_guid": {"$ref": "#/definitions/guid"},
287
+ "width": {"type": "number"},
288
+ "height": {"type": "number"}
289
+ },
290
+ "required": [
291
+ "author", "guid", "public", "created_at", "remote_photo_path", "remote_photo_name", "width", "height"
292
+ ]
293
+ }
294
+ }
295
+ },
296
+
297
+ "poll_answer": {
298
+ "type": "object",
299
+ "properties": {
300
+ "entity_type": {
301
+ "type": "string",
302
+ "pattern": "^poll_answer$"
303
+ },
304
+ "entity_data": {
305
+ "type": "object",
306
+ "properties": {
307
+ "guid": { "$ref": "#/definitions/guid" },
308
+ "answer": { "type": "string" }
309
+ },
310
+ "required": [
311
+ "answer",
312
+ "guid"
313
+ ]
314
+ }
315
+ }
316
+ },
317
+
318
+ "poll": {
319
+ "type": "object",
320
+ "properties": {
321
+ "entity_type": {
322
+ "type": "string",
323
+ "pattern": "^poll$"
324
+ },
325
+ "entity_data": {
326
+ "type": "object",
327
+ "properties": {
328
+ "guid": {
329
+ "$ref": "#/definitions/guid"
330
+ },
331
+ "question": {
332
+ "type": "string"
333
+ },
334
+ "poll_answers": {
335
+ "type": "array",
336
+ "items": {
337
+ "$ref": "#/definitions/poll_answer"
338
+ }
339
+ }
340
+ },
341
+ "required": [
342
+ "guid",
343
+ "question",
344
+ "poll_answers"
345
+ ]
346
+ }
347
+ }
348
+ },
349
+
350
+ "location": {
351
+ "type": "object",
352
+ "properties": {
353
+ "entity_type": {
354
+ "type": "string",
355
+ "pattern": "^location$"
356
+ },
357
+ "entity_data": {
358
+ "type": "object",
359
+ "properties": {
360
+ "address": {
361
+ "type": "string"
362
+ },
363
+ "lat": {
364
+ "type": "string"
365
+ },
366
+ "lng": {
367
+ "type": "string"
368
+ }
369
+ },
370
+ "required": [
371
+ "address",
372
+ "lat",
373
+ "lng"
374
+ ]
375
+ }
376
+ }
377
+ }
378
+ }
379
+ }
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: diaspora_federation-json_schema
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Benjamin Neff
8
+ - cmrd Senya
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2017-07-02 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: This gem provides JSON schemas (currently one schema) for validating
15
+ JSON serialized federation objects.
16
+ email:
17
+ - benjamin@coding4.coffee
18
+ - senya@riseup.net
19
+ executables: []
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - lib/diaspora_federation/schemas/federation_entities.json
24
+ homepage: https://github.com/diaspora/diaspora_federation
25
+ licenses:
26
+ - AGPL-3.0
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.6.8
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: diaspora* federation json schemas
48
+ test_files: []