Skip to content

Commit 930e7ee

Browse files
feat(http): support passing JsonSerializable to Json response (#1626)
1 parent 0c03385 commit 930e7ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/http/src/Responses/Json.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Tempest\Http\Responses;
66

7+
use JsonSerializable;
78
use Tempest\Http\Header;
89
use Tempest\Http\IsResponse;
910
use Tempest\Http\Response;
@@ -13,7 +14,7 @@ final class Json implements Response
1314
{
1415
use IsResponse;
1516

16-
public function __construct(?array $body = null)
17+
public function __construct(JsonSerializable|array|null $body = null)
1718
{
1819
$this->status = Status::OK;
1920
$this->body = $body;

0 commit comments

Comments
 (0)