A better Rust ATProto crate
1{
2 "lexicon": 1,
3 "id": "app.bsky.richtext.facet",
4 "defs": {
5 "main": {
6 "type": "object",
7 "description": "Annotation of a sub-string within rich text.",
8 "required": ["index", "features"],
9 "properties": {
10 "index": { "type": "ref", "ref": "#byteSlice" },
11 "features": {
12 "type": "array",
13 "items": { "type": "union", "refs": ["#mention", "#link", "#tag"] }
14 }
15 }
16 },
17 "mention": {
18 "type": "object",
19 "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.",
20 "required": ["did"],
21 "properties": {
22 "did": { "type": "string", "format": "did" }
23 }
24 },
25 "link": {
26 "type": "object",
27 "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.",
28 "required": ["uri"],
29 "properties": {
30 "uri": { "type": "string", "format": "uri" }
31 }
32 },
33 "tag": {
34 "type": "object",
35 "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').",
36 "required": ["tag"],
37 "properties": {
38 "tag": { "type": "string", "maxLength": 640, "maxGraphemes": 64 }
39 }
40 },
41 "byteSlice": {
42 "type": "object",
43 "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.",
44 "required": ["byteStart", "byteEnd"],
45 "properties": {
46 "byteStart": { "type": "integer", "minimum": 0 },
47 "byteEnd": { "type": "integer", "minimum": 0 }
48 }
49 }
50 }
51}