diff --git a/src/Controller/ApiController.php b/src/Controller/ApiController.php index dfb72de..18e55d4 100644 --- a/src/Controller/ApiController.php +++ b/src/Controller/ApiController.php @@ -13,6 +13,7 @@ use Citrus\CitrusException; use Citrus\Http\Server\Request; use Citrus\Http\Server\Response; +use Citrus\Http\Server\ResponseTo; use Citrus\Logger; use Citrus\Message; use Citrus\Message\MessageItem; @@ -46,6 +47,7 @@ public function run(Router|null $router = null): void $request = Request::generate(); $this->initialize($request); + /** @var ResponseTo $response */ $response = $this->$action_name($request); $this->release($request); if (true === Message::exists()) @@ -65,7 +67,7 @@ public function run(Router|null $router = null): void $response_json = json_encode($response); // 出力 - echo $response_json; + echo $response->toJson(); } /**