handy online tools for AT Protocol boat.kelinci.net
atproto bluesky atcute typescript solidjs

feat: lexicon document schema

mary.my.id 623ee0e8 41ca76be

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