When attempting to create a post with one or more images (or other media, I assume) and an omitted text property, the endpoint returns a Bad Request.
To Reproduce
Steps to reproduce the behavior:
Attempt to create a new post
Upload and attach media files to embed
Omit the text property
$body = [
'collection' => 'app.bsky.feed.post',
'repo' => '<repo-did>',
'record' => [
// the text property is empty and can be omitted
'text' => '',
'createdAt' => date('c'),
'$type' => 'app.bsky.feed.post',
'embed' => [
'$type' => 'app.bsky.embed.images',
'images' => [/* array of one or more images*/],
],
],
];
Expected behavior
The post should be created and a 200/OK should be returned instead. A post without text body and only media embeds is perfectly valid.
Details
Operating system: N/A
Node version: N/A
Additional context
I see that in the Lexicon, the text property is listed as required
Describe the bug
When attempting to create a post with one or more images (or other media, I assume) and an omitted
text
property, the endpoint returns aBad Request
.To Reproduce
Steps to reproduce the behavior:
text
propertyExpected behavior
The post should be created and a
200/OK
should be returned instead. A post without text body and only media embeds is perfectly valid.Details
Additional context
I see that in the Lexicon, the
text
property is listed asrequired
https://github.com/bluesky-social/atproto/blob/8a4d06c367691fec359be21ed46418111b39231f/lexicons/app/bsky/feed/post.json#L11
It should be conditional instead, depending on whether the body contains media/other embeds.