-
Notifications
You must be signed in to change notification settings - Fork 0
Finalize Beekeeper API #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for HTML-formatted content in post creation by introducing an html parameter alongside the existing text parameter. Both fields are now optional, allowing posts to be created with either plain text, HTML, or both.
- Adds optional
htmlparameter toCreateAPostInAGivenStreamrequest - Makes
textparameter optional (previously required) - Updates documentation to reflect the new
htmlfield in the response
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Requests/CreateAPostInAGivenStream.php | Adds optional html parameter, makes text optional, and includes html in request body |
| src/Requests/CreateAChildToAnArtifact.php | Adds blank line in defaultBody() method (appears unintentional) |
| README.md | Documents the new html parameter in both request examples and response structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| protected readonly string $streamId, | ||
| protected readonly string $text, | ||
| protected readonly ?string $text = null, | ||
| protected readonly ?string $html = null, |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The html parameter is added to the request constructor and body, but the Post data class (at src/Data/Streams/Post.php) does not have an html property. This means that when the API response includes an html field, it will be silently ignored and not accessible on the returned Post object.
You need to add the html property to the Post class constructor and the make() method:
public function __construct(
public int $id,
public ?string $text,
public ?string $html, // Add this
// ... rest of properties
)And in the make() method:
return new self(
id: Arr::get($data, 'id'),
text: Arr::get($data, 'text'),
html: Arr::get($data, 'html'), // Add this
// ... rest of properties
)| protected readonly ?string $text = null, | ||
| protected readonly ?string $html = null, |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both text and html parameters are now optional (nullable with default null), but there's no validation to ensure that at least one of them is provided. Creating a post with neither text nor html would likely result in an API error.
Consider adding validation in the constructor to ensure at least one content field is provided:
public function __construct(
protected readonly string $streamId,
protected readonly ?string $text = null,
protected readonly ?string $html = null,
// ... rest of parameters
) {
if (empty($this->text) && empty($this->html)) {
throw new \InvalidArgumentException('Either text or html must be provided');
}
}|
|
||
| public function defaultBody(): array | ||
| { | ||
|
|
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This extra blank line appears to be unintentional and doesn't add value to the code. Consider removing it to maintain consistency with the codebase style.
| +id: 2234 // int | ||
| +text: "Please indicate your preferred dates for next team event in the poll below. Thanks!" // string | ||
| +text: "Please indicate your preferred dates for next team event in the poll below. Thanks!" // string|null | ||
| +html: "<p>Please <b>indicate</b> your preferred dates below.</p><p>Thanks!</p>" // string|null |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation shows that the Post response object has an html property, but the actual Post data class at src/Data/Streams/Post.php does not include this field. This documentation is misleading as the html field will not actually be available on the returned Post object until the data class is updated.
This documentation should either be removed or the Post data class should be updated to include the html property.
| +html: "<p>Please <b>indicate</b> your preferred dates below.</p><p>Thanks!</p>" // string|null |
No description provided.