code: public function send(ResponseInterface $response): ResponseInterface
      {
          $response->getBody()->write(json_encode($this->toArray()));
          return $response->withHeader('Content-Type', self::MIME_TYPE_JSON);
      }
docs: Adds this problem detail to a PSR-7 HTTP response.
  
  @param ResponseInterface $response The HTTP response
  @return ResponseInterface The new response