tangled
alpha
login
or
join now
mary.my.id
/
boat
22
fork
atom
handy online tools for AT Protocol
boat.kelinci.net
atproto
bluesky
atcute
typescript
solidjs
22
fork
atom
overview
issues
pulls
pipelines
feat: lexicon document schema
mary.my.id
1 year ago
623ee0e8
41ca76be
verified
This commit was signed with the committer's
known signature
.
mary.my.id
SSH Key Fingerprint:
SHA256:ZlTP/auFSGpGnaoDg4mCTG1g9OZvXp62jWR4c6H4O3c=
+471
1 changed file
expand all
collapse all
unified
split
public
lexicon-document.json
+471
public/lexicon-document.json
···
1
1
+
{
2
2
+
"$schema": "https://json-schema.org/draft-07/schema",
3
3
+
"type": "object",
4
4
+
"title": "An atproto lexicon document",
5
5
+
"properties": {
6
6
+
"lexicon": { "type": "number", "const": 1 },
7
7
+
"id": {
8
8
+
"type": "string",
9
9
+
"pattern": "^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\\.[a-zA-Z]([a-zA-Z]{0,61}[a-zA-Z])?)$"
10
10
+
},
11
11
+
"revision": { "type": "integer", "minimum": 0 },
12
12
+
"description": { "type": "string" },
13
13
+
"defs": {
14
14
+
"anyOf": [
15
15
+
{
16
16
+
"type": "object",
17
17
+
"properties": {
18
18
+
"main": { "$ref": "#/definitions/RecordSchema" },
19
19
+
"record": { "not": {} }
20
20
+
},
21
21
+
"required": ["main"],
22
22
+
"additionalProperties": { "$ref": "#/definitions/UserTypeSchema" }
23
23
+
},
24
24
+
{
25
25
+
"type": "object",
26
26
+
"properties": {
27
27
+
"main": {
28
28
+
"anyOf": [
29
29
+
{ "$ref": "#/definitions/XrpcQuerySchema" },
30
30
+
{ "$ref": "#/definitions/XrpcProcedureSchema" }
31
31
+
]
32
32
+
},
33
33
+
"params": { "not": {} },
34
34
+
"input": { "not": {} },
35
35
+
"output": { "not": {} },
36
36
+
"errors": { "not": {} }
37
37
+
},
38
38
+
"required": ["main"],
39
39
+
"additionalProperties": { "$ref": "#/definitions/UserTypeSchema" }
40
40
+
},
41
41
+
{
42
42
+
"type": "object",
43
43
+
"properties": {
44
44
+
"main": { "$ref": "#/definitions/XrpcSubscriptionSchema" },
45
45
+
"params": { "not": {} },
46
46
+
"message": { "not": {} }
47
47
+
},
48
48
+
"required": ["main"],
49
49
+
"additionalProperties": { "$ref": "#/definitions/UserTypeSchema" }
50
50
+
},
51
51
+
{
52
52
+
"type": "object",
53
53
+
"additionalProperties": { "$ref": "#/definitions/UserTypeSchema" }
54
54
+
}
55
55
+
]
56
56
+
},
57
57
+
"$schema": { "type": "string" }
58
58
+
},
59
59
+
"required": ["lexicon", "id", "defs"],
60
60
+
"additionalProperties": false,
61
61
+
"definitions": {
62
62
+
"ArraySchema": {
63
63
+
"type": "object",
64
64
+
"properties": {
65
65
+
"type": { "type": "string", "const": "array" },
66
66
+
"description": { "type": "string" },
67
67
+
"items": {
68
68
+
"anyOf": [
69
69
+
{ "$ref": "#/definitions/PrimitiveSchema" },
70
70
+
{ "$ref": "#/definitions/IpldTypeSchema" },
71
71
+
{ "$ref": "#/definitions/BlobSchema" },
72
72
+
{ "$ref": "#/definitions/RefVariantSchema" }
73
73
+
]
74
74
+
},
75
75
+
"maxLength": { "type": "integer", "minimum": 0 },
76
76
+
"minLength": { "type": "integer", "minimum": 0 }
77
77
+
},
78
78
+
"required": ["type", "items"],
79
79
+
"additionalProperties": false
80
80
+
},
81
81
+
"BaseStringSchema": {
82
82
+
"type": "object",
83
83
+
"properties": {
84
84
+
"type": { "type": "string", "const": "string" },
85
85
+
"description": { "type": "string" },
86
86
+
"default": { "type": "string" },
87
87
+
"const": { "type": "string" },
88
88
+
"enum": { "type": "array", "items": { "type": "string" } },
89
89
+
"knownValues": { "type": "array", "items": { "type": "string" } }
90
90
+
},
91
91
+
"required": ["type"],
92
92
+
"additionalProperties": false
93
93
+
},
94
94
+
"BlobSchema": {
95
95
+
"type": "object",
96
96
+
"properties": {
97
97
+
"type": { "type": "string", "const": "blob" },
98
98
+
"description": { "type": "string" },
99
99
+
"accept": { "type": "array", "items": { "type": "string" } },
100
100
+
"maxSize": { "type": "integer", "minimum": 0 }
101
101
+
},
102
102
+
"required": ["type"],
103
103
+
"additionalProperties": false
104
104
+
},
105
105
+
"BooleanSchema": {
106
106
+
"type": "object",
107
107
+
"properties": {
108
108
+
"type": { "type": "string", "const": "boolean" },
109
109
+
"description": { "type": "string" },
110
110
+
"default": { "type": "boolean" },
111
111
+
"const": { "type": "boolean" }
112
112
+
},
113
113
+
"required": ["type"],
114
114
+
"additionalProperties": false
115
115
+
},
116
116
+
"BytesSchema": {
117
117
+
"type": "object",
118
118
+
"properties": {
119
119
+
"type": { "type": "string", "const": "bytes" },
120
120
+
"description": { "type": "string" },
121
121
+
"maxLength": { "type": "integer", "minimum": 0 },
122
122
+
"minLength": { "type": "integer", "minimum": 0 }
123
123
+
},
124
124
+
"required": ["type"],
125
125
+
"additionalProperties": false
126
126
+
},
127
127
+
"CidLinkSchema": {
128
128
+
"type": "object",
129
129
+
"properties": {
130
130
+
"type": { "type": "string", "const": "cid-link" },
131
131
+
"description": { "type": "string" }
132
132
+
},
133
133
+
"required": ["type"],
134
134
+
"additionalProperties": false
135
135
+
},
136
136
+
"FormattedStringSchema": {
137
137
+
"type": "object",
138
138
+
"properties": {
139
139
+
"type": { "$ref": "#/definitions/BaseStringSchema/properties/type" },
140
140
+
"description": {
141
141
+
"$ref": "#/definitions/BaseStringSchema/properties/description"
142
142
+
},
143
143
+
"default": {
144
144
+
"$ref": "#/definitions/BaseStringSchema/properties/default"
145
145
+
},
146
146
+
"const": { "$ref": "#/definitions/BaseStringSchema/properties/const" },
147
147
+
"enum": { "$ref": "#/definitions/BaseStringSchema/properties/enum" },
148
148
+
"knownValues": {
149
149
+
"$ref": "#/definitions/BaseStringSchema/properties/knownValues"
150
150
+
},
151
151
+
"format": {
152
152
+
"type": "string",
153
153
+
"enum": [
154
154
+
"at-identifier",
155
155
+
"at-uri",
156
156
+
"cid",
157
157
+
"datetime",
158
158
+
"did",
159
159
+
"handle",
160
160
+
"language",
161
161
+
"nsid",
162
162
+
"record-key",
163
163
+
"tid",
164
164
+
"uri"
165
165
+
]
166
166
+
}
167
167
+
},
168
168
+
"required": ["type", "format"],
169
169
+
"additionalProperties": false
170
170
+
},
171
171
+
"IntegerSchema": {
172
172
+
"type": "object",
173
173
+
"properties": {
174
174
+
"type": { "type": "string", "const": "integer" },
175
175
+
"description": { "type": "string" },
176
176
+
"default": { "type": "integer", "minimum": 0 },
177
177
+
"const": { "type": "integer", "minimum": 0 },
178
178
+
"enum": {
179
179
+
"type": "array",
180
180
+
"items": { "type": "integer", "minimum": 0 }
181
181
+
},
182
182
+
"maximum": { "type": "integer", "minimum": 0 },
183
183
+
"minimum": { "type": "integer", "minimum": 0 }
184
184
+
},
185
185
+
"required": ["type"],
186
186
+
"additionalProperties": false
187
187
+
},
188
188
+
"IpldTypeSchema": {
189
189
+
"anyOf": [{ "$ref": "#/definitions/BytesSchema" }, { "$ref": "#/definitions/CidLinkSchema" }]
190
190
+
},
191
191
+
"MainUserTypeSchema": {
192
192
+
"anyOf": [
193
193
+
{ "$ref": "#/definitions/RecordSchema" },
194
194
+
{ "$ref": "#/definitions/XrpcQuerySchema" },
195
195
+
{ "$ref": "#/definitions/XrpcProcedureSchema" },
196
196
+
{ "$ref": "#/definitions/XrpcSubscriptionSchema" },
197
197
+
{ "$ref": "#/definitions/BlobSchema" },
198
198
+
{ "$ref": "#/definitions/ArraySchema" },
199
199
+
{ "$ref": "#/definitions/TokenSchema" },
200
200
+
{ "$ref": "#/definitions/ObjectSchema" },
201
201
+
{ "$ref": "#/definitions/BooleanSchema" },
202
202
+
{ "$ref": "#/definitions/IntegerSchema" },
203
203
+
{ "$ref": "#/definitions/StringSchema" },
204
204
+
{ "$ref": "#/definitions/BytesSchema" },
205
205
+
{ "$ref": "#/definitions/CidLinkSchema" },
206
206
+
{ "$ref": "#/definitions/UnknownSchema" }
207
207
+
]
208
208
+
},
209
209
+
"ObjectSchema": {
210
210
+
"type": "object",
211
211
+
"properties": {
212
212
+
"type": { "type": "string", "const": "object" },
213
213
+
"description": { "type": "string" },
214
214
+
"required": {
215
215
+
"type": "array",
216
216
+
"items": { "type": "string" },
217
217
+
"default": []
218
218
+
},
219
219
+
"nullable": {
220
220
+
"type": "array",
221
221
+
"items": { "type": "string" },
222
222
+
"default": []
223
223
+
},
224
224
+
"properties": {
225
225
+
"type": "object",
226
226
+
"additionalProperties": {
227
227
+
"anyOf": [
228
228
+
{ "$ref": "#/definitions/RefVariantSchema" },
229
229
+
{ "$ref": "#/definitions/IpldTypeSchema" },
230
230
+
{ "$ref": "#/definitions/ArraySchema" },
231
231
+
{ "$ref": "#/definitions/BlobSchema" },
232
232
+
{ "$ref": "#/definitions/PrimitiveSchema" }
233
233
+
]
234
234
+
}
235
235
+
}
236
236
+
},
237
237
+
"required": ["type", "properties"],
238
238
+
"additionalProperties": false
239
239
+
},
240
240
+
"PrimitiveArraySchema": {
241
241
+
"type": "object",
242
242
+
"properties": {
243
243
+
"type": { "$ref": "#/definitions/ArraySchema/properties/type" },
244
244
+
"description": {
245
245
+
"$ref": "#/definitions/ArraySchema/properties/description"
246
246
+
},
247
247
+
"items": { "$ref": "#/definitions/PrimitiveSchema" },
248
248
+
"maxLength": {
249
249
+
"$ref": "#/definitions/ArraySchema/properties/maxLength"
250
250
+
},
251
251
+
"minLength": {
252
252
+
"$ref": "#/definitions/ArraySchema/properties/minLength"
253
253
+
}
254
254
+
},
255
255
+
"required": ["type", "items"],
256
256
+
"additionalProperties": false
257
257
+
},
258
258
+
"PrimitiveSchema": {
259
259
+
"anyOf": [
260
260
+
{ "$ref": "#/definitions/BooleanSchema" },
261
261
+
{ "$ref": "#/definitions/IntegerSchema" },
262
262
+
{ "$ref": "#/definitions/StringSchema" },
263
263
+
{ "$ref": "#/definitions/UnknownSchema" }
264
264
+
]
265
265
+
},
266
266
+
"RecordSchema": {
267
267
+
"type": "object",
268
268
+
"properties": {
269
269
+
"type": { "type": "string", "const": "record" },
270
270
+
"description": { "type": "string" },
271
271
+
"key": { "type": "string" },
272
272
+
"record": { "$ref": "#/definitions/ObjectSchema" }
273
273
+
},
274
274
+
"required": ["type", "record"],
275
275
+
"additionalProperties": false
276
276
+
},
277
277
+
"RefSchema": {
278
278
+
"type": "object",
279
279
+
"properties": {
280
280
+
"type": { "type": "string", "const": "ref" },
281
281
+
"description": { "type": "string" },
282
282
+
"ref": {
283
283
+
"type": "string",
284
284
+
"minLength": 1,
285
285
+
"pattern": "^(?=.)(?:[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?:\\.[a-zA-Z](?:[a-zA-Z]{0,61}[a-zA-Z])?))?(?:#[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)?$"
286
286
+
}
287
287
+
},
288
288
+
"required": ["type", "ref"],
289
289
+
"additionalProperties": false
290
290
+
},
291
291
+
"RefUnionSchema": {
292
292
+
"type": "object",
293
293
+
"properties": {
294
294
+
"type": { "type": "string", "const": "union" },
295
295
+
"description": { "type": "string" },
296
296
+
"refs": {
297
297
+
"type": "array",
298
298
+
"items": { "$ref": "#/definitions/RefSchema/properties/ref" }
299
299
+
},
300
300
+
"closed": { "type": "boolean", "default": false }
301
301
+
},
302
302
+
"required": ["type", "refs"],
303
303
+
"additionalProperties": false
304
304
+
},
305
305
+
"RefVariantSchema": {
306
306
+
"anyOf": [{ "$ref": "#/definitions/RefSchema" }, { "$ref": "#/definitions/RefUnionSchema" }]
307
307
+
},
308
308
+
"StringSchema": {
309
309
+
"anyOf": [
310
310
+
{ "$ref": "#/definitions/UnformattedStringSchema" },
311
311
+
{ "$ref": "#/definitions/FormattedStringSchema" }
312
312
+
]
313
313
+
},
314
314
+
"TokenSchema": {
315
315
+
"type": "object",
316
316
+
"properties": {
317
317
+
"type": { "type": "string", "const": "token" },
318
318
+
"description": { "type": "string" }
319
319
+
},
320
320
+
"required": ["type"],
321
321
+
"additionalProperties": false
322
322
+
},
323
323
+
"UnformattedStringSchema": {
324
324
+
"type": "object",
325
325
+
"properties": {
326
326
+
"type": { "$ref": "#/definitions/BaseStringSchema/properties/type" },
327
327
+
"description": {
328
328
+
"$ref": "#/definitions/BaseStringSchema/properties/description"
329
329
+
},
330
330
+
"default": {
331
331
+
"$ref": "#/definitions/BaseStringSchema/properties/default"
332
332
+
},
333
333
+
"const": { "$ref": "#/definitions/BaseStringSchema/properties/const" },
334
334
+
"enum": { "$ref": "#/definitions/BaseStringSchema/properties/enum" },
335
335
+
"knownValues": {
336
336
+
"$ref": "#/definitions/BaseStringSchema/properties/knownValues"
337
337
+
},
338
338
+
"format": { "not": {} },
339
339
+
"maxLength": { "type": "integer", "exclusiveMinimum": 0 },
340
340
+
"minLength": { "type": "integer", "exclusiveMinimum": 0 },
341
341
+
"maxGraphemes": { "type": "integer", "exclusiveMinimum": 0 },
342
342
+
"minGraphemes": { "type": "integer", "exclusiveMinimum": 0 }
343
343
+
},
344
344
+
"required": ["type"],
345
345
+
"additionalProperties": false
346
346
+
},
347
347
+
"UnknownSchema": {
348
348
+
"type": "object",
349
349
+
"properties": {
350
350
+
"type": { "type": "string", "const": "unknown" },
351
351
+
"description": { "type": "string" }
352
352
+
},
353
353
+
"required": ["type"],
354
354
+
"additionalProperties": false
355
355
+
},
356
356
+
"UserTypeSchema": {
357
357
+
"anyOf": [
358
358
+
{ "$ref": "#/definitions/BlobSchema" },
359
359
+
{ "$ref": "#/definitions/ArraySchema" },
360
360
+
{ "$ref": "#/definitions/TokenSchema" },
361
361
+
{ "$ref": "#/definitions/ObjectSchema" },
362
362
+
{ "$ref": "#/definitions/BooleanSchema" },
363
363
+
{ "$ref": "#/definitions/IntegerSchema" },
364
364
+
{ "$ref": "#/definitions/StringSchema" },
365
365
+
{ "$ref": "#/definitions/BytesSchema" },
366
366
+
{ "$ref": "#/definitions/CidLinkSchema" },
367
367
+
{ "$ref": "#/definitions/UnknownSchema" }
368
368
+
]
369
369
+
},
370
370
+
"XrpcBodySchema": {
371
371
+
"type": "object",
372
372
+
"properties": {
373
373
+
"description": { "type": "string" },
374
374
+
"encoding": { "type": "string" },
375
375
+
"schema": {
376
376
+
"anyOf": [{ "$ref": "#/definitions/RefVariantSchema" }, { "$ref": "#/definitions/ObjectSchema" }]
377
377
+
}
378
378
+
},
379
379
+
"required": ["encoding"],
380
380
+
"additionalProperties": false
381
381
+
},
382
382
+
"XrpcErrorSchema": {
383
383
+
"type": "object",
384
384
+
"properties": {
385
385
+
"name": { "type": "string" },
386
386
+
"description": { "type": "string" }
387
387
+
},
388
388
+
"required": ["name"],
389
389
+
"additionalProperties": false
390
390
+
},
391
391
+
"XrpcParametersSchema": {
392
392
+
"type": "object",
393
393
+
"properties": {
394
394
+
"type": { "type": "string", "const": "params" },
395
395
+
"description": { "type": "string" },
396
396
+
"required": {
397
397
+
"type": "array",
398
398
+
"items": { "type": "string" },
399
399
+
"default": []
400
400
+
},
401
401
+
"properties": {
402
402
+
"type": "object",
403
403
+
"additionalProperties": {
404
404
+
"anyOf": [
405
405
+
{ "$ref": "#/definitions/PrimitiveSchema" },
406
406
+
{ "$ref": "#/definitions/PrimitiveArraySchema" }
407
407
+
]
408
408
+
}
409
409
+
}
410
410
+
},
411
411
+
"required": ["type", "properties"],
412
412
+
"additionalProperties": false
413
413
+
},
414
414
+
"XrpcProcedureSchema": {
415
415
+
"type": "object",
416
416
+
"properties": {
417
417
+
"type": { "type": "string", "const": "procedure" },
418
418
+
"description": { "type": "string" },
419
419
+
"parameters": { "$ref": "#/definitions/XrpcParametersSchema" },
420
420
+
"input": { "$ref": "#/definitions/XrpcBodySchema" },
421
421
+
"output": { "$ref": "#/definitions/XrpcBodySchema" },
422
422
+
"errors": {
423
423
+
"type": "array",
424
424
+
"items": { "$ref": "#/definitions/XrpcErrorSchema" }
425
425
+
}
426
426
+
},
427
427
+
"required": ["type"],
428
428
+
"additionalProperties": false
429
429
+
},
430
430
+
"XrpcQuerySchema": {
431
431
+
"type": "object",
432
432
+
"properties": {
433
433
+
"type": { "type": "string", "const": "query" },
434
434
+
"description": { "type": "string" },
435
435
+
"parameters": { "$ref": "#/definitions/XrpcParametersSchema" },
436
436
+
"output": { "$ref": "#/definitions/XrpcBodySchema" },
437
437
+
"errors": {
438
438
+
"type": "array",
439
439
+
"items": { "$ref": "#/definitions/XrpcErrorSchema" }
440
440
+
}
441
441
+
},
442
442
+
"required": ["type"],
443
443
+
"additionalProperties": false
444
444
+
},
445
445
+
"XrpcSubscriptionMessageSchema": {
446
446
+
"type": "object",
447
447
+
"properties": {
448
448
+
"description": { "type": "string" },
449
449
+
"schema": {
450
450
+
"anyOf": [{ "$ref": "#/definitions/RefVariantSchema" }, { "$ref": "#/definitions/ObjectSchema" }]
451
451
+
}
452
452
+
},
453
453
+
"additionalProperties": false
454
454
+
},
455
455
+
"XrpcSubscriptionSchema": {
456
456
+
"type": "object",
457
457
+
"properties": {
458
458
+
"type": { "type": "string", "const": "subscription" },
459
459
+
"description": { "type": "string" },
460
460
+
"parameters": { "$ref": "#/definitions/XrpcParametersSchema" },
461
461
+
"message": { "$ref": "#/definitions/XrpcSubscriptionMessageSchema" },
462
462
+
"errors": {
463
463
+
"type": "array",
464
464
+
"items": { "$ref": "#/definitions/XrpcErrorSchema" }
465
465
+
}
466
466
+
},
467
467
+
"required": ["type"],
468
468
+
"additionalProperties": false
469
469
+
}
470
470
+
}
471
471
+
}