alpha
Login
or
Join now
ptr.pet
/
the-one-who-tests
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
test
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Fix generated draft lex types
author
Michael Black
date
1 month ago
(Jun 5, 2026, 4:05 PM -0500)
commit
ac744e84
ac744e8443c6e8f60af7bc58e75f5d67f5ab37d6
parent
64ec991b
64ec991b0743e20ade0a1061be001ba83a0fcc52
+54
-36
2 changed files
Expand all
Collapse all
Unified
Split
api
bsky
draftdefs.go
lexicons
app
bsky
draft
defs.json
+36
-32
api/bsky/draftdefs.go
View file
Reviewed
···
41
41
Uri string `json:"uri" cborgen:"uri"`
42
42
}
43
43
44
44
+
// DraftDefs_DraftEmbedGallery is a "draftEmbedGallery" in the app.bsky.draft.defs schema.
45
45
+
type DraftDefs_DraftEmbedGallery struct {
46
46
+
Items []DraftDefs_DraftEmbedGalleryItems_Elem `json:"items" cborgen:"items"`
47
47
+
}
48
48
+
49
49
+
type DraftDefs_DraftEmbedGalleryItems_Elem struct {
50
50
+
DraftDefs_DraftEmbedImage *DraftDefs_DraftEmbedImage
51
51
+
}
52
52
+
53
53
+
func (t *DraftDefs_DraftEmbedGalleryItems_Elem) MarshalJSON() ([]byte, error) {
54
54
+
if t.DraftDefs_DraftEmbedImage != nil {
55
55
+
t.DraftDefs_DraftEmbedImage.LexiconTypeID = "app.bsky.draft.defs#draftEmbedImage"
56
56
+
return json.Marshal(t.DraftDefs_DraftEmbedImage)
57
57
+
}
58
58
+
return nil, fmt.Errorf("can not marshal empty union as JSON")
59
59
+
}
60
60
+
61
61
+
func (t *DraftDefs_DraftEmbedGalleryItems_Elem) UnmarshalJSON(b []byte) error {
62
62
+
typ, err := lexutil.TypeExtract(b)
63
63
+
if err != nil {
64
64
+
return err
65
65
+
}
66
66
+
67
67
+
switch typ {
68
68
+
case "app.bsky.draft.defs#draftEmbedImage":
69
69
+
t.DraftDefs_DraftEmbedImage = new(DraftDefs_DraftEmbedImage)
70
70
+
return json.Unmarshal(b, t.DraftDefs_DraftEmbedImage)
71
71
+
default:
72
72
+
return nil
73
73
+
}
74
74
+
}
75
75
+
44
76
// DraftDefs_DraftEmbedImage is a "draftEmbedImage" in the app.bsky.draft.defs schema.
45
77
type DraftDefs_DraftEmbedImage struct {
46
78
LexiconTypeID string `json:"$type" cborgen:"$type,const=app.bsky.draft.defs#draftEmbedImage"`
···
71
103
// One of the posts that compose a draft.
72
104
type DraftDefs_DraftPost struct {
73
105
EmbedExternals []*DraftDefs_DraftEmbedExternal `json:"embedExternals,omitempty" cborgen:"embedExternals,omitempty"`
74
74
-
// embedGallery: The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.
75
75
-
EmbedGallery []*DraftDefs_DraftPost_EmbedGallery_Elem `json:"embedGallery,omitempty" cborgen:"embedGallery,omitempty"`
76
76
-
EmbedImages []*DraftDefs_DraftEmbedImage `json:"embedImages,omitempty" cborgen:"embedImages,omitempty"`
77
77
-
EmbedRecords []*DraftDefs_DraftEmbedRecord `json:"embedRecords,omitempty" cborgen:"embedRecords,omitempty"`
78
78
-
EmbedVideos []*DraftDefs_DraftEmbedVideo `json:"embedVideos,omitempty" cborgen:"embedVideos,omitempty"`
106
106
+
EmbedGallery *DraftDefs_DraftEmbedGallery `json:"embedGallery,omitempty" cborgen:"embedGallery,omitempty"`
107
107
+
EmbedImages []*DraftDefs_DraftEmbedImage `json:"embedImages,omitempty" cborgen:"embedImages,omitempty"`
108
108
+
EmbedRecords []*DraftDefs_DraftEmbedRecord `json:"embedRecords,omitempty" cborgen:"embedRecords,omitempty"`
109
109
+
EmbedVideos []*DraftDefs_DraftEmbedVideo `json:"embedVideos,omitempty" cborgen:"embedVideos,omitempty"`
79
110
// labels: Self-label values for this post. Effectively content warnings.
80
111
Labels *DraftDefs_DraftPost_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"`
81
112
// text: The primary post content. It has a higher limit than post contents to allow storing a larger text that can later be refined into smaller posts.
82
113
Text string `json:"text" cborgen:"text"`
83
83
-
}
84
84
-
85
85
-
type DraftDefs_DraftPost_EmbedGallery_Elem struct {
86
86
-
DraftDefs_DraftEmbedImage *DraftDefs_DraftEmbedImage
87
87
-
}
88
88
-
89
89
-
func (t *DraftDefs_DraftPost_EmbedGallery_Elem) MarshalJSON() ([]byte, error) {
90
90
-
if t.DraftDefs_DraftEmbedImage != nil {
91
91
-
t.DraftDefs_DraftEmbedImage.LexiconTypeID = "app.bsky.draft.defs#draftEmbedImage"
92
92
-
return json.Marshal(t.DraftDefs_DraftEmbedImage)
93
93
-
}
94
94
-
return nil, fmt.Errorf("can not marshal empty union as JSON")
95
95
-
}
96
96
-
97
97
-
func (t *DraftDefs_DraftPost_EmbedGallery_Elem) UnmarshalJSON(b []byte) error {
98
98
-
typ, err := lexutil.TypeExtract(b)
99
99
-
if err != nil {
100
100
-
return err
101
101
-
}
102
102
-
103
103
-
switch typ {
104
104
-
case "app.bsky.draft.defs#draftEmbedImage":
105
105
-
t.DraftDefs_DraftEmbedImage = new(DraftDefs_DraftEmbedImage)
106
106
-
return json.Unmarshal(b, t.DraftDefs_DraftEmbedImage)
107
107
-
default:
108
108
-
return nil
109
109
-
}
110
114
}
111
115
112
116
// Self-label values for this post. Effectively content warnings.
+18
-4
lexicons/app/bsky/draft/defs.json
View file
Reviewed
···
96
96
"maxLength": 4
97
97
},
98
98
"embedGallery": {
99
99
-
"type": "array",
100
100
-
"items": { "type": "union", "refs": ["#draftEmbedImage"] },
101
101
-
"maxLength": 20,
102
102
-
"description": "The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs."
99
99
+
"type": "ref",
100
100
+
"ref": "#draftEmbedGallery"
103
101
},
104
102
"embedVideos": {
105
103
"type": "array",
···
173
171
}
174
172
},
175
173
174
174
+
"draftEmbedGallery": {
175
175
+
"type": "object",
176
176
+
"required": ["items"],
177
177
+
"properties": {
178
178
+
"items": {
179
179
+
"type": "ref",
180
180
+
"ref": "#draftEmbedGalleryItems"
181
181
+
}
182
182
+
}
183
183
+
},
184
184
+
"draftEmbedGalleryItems": {
185
185
+
"type": "array",
186
186
+
"items": { "type": "union", "refs": ["#draftEmbedImage"] },
187
187
+
"maxLength": 20,
188
188
+
"description": "The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs."
189
189
+
},
176
190
"draftEmbedImage": {
177
191
"type": "object",
178
192
"required": ["localRef"],