validateResponse example



    $this->doValidateResponse($response$event->getRequest());
  }

  /** * Wraps validation in an assert to prevent execution in production. * * @see self::validateResponse */
  public function doValidateResponse(Response $response, Request $request) {
    assert($this->validateResponse($response$request), 'A JSON:API response failed validation (see the logs for details). Please report this in the issue queue on drupal.org');
  }

  /** * Validates a response against the JSON:API specification. * * @param \Symfony\Component\HttpFoundation\Response $response * The response to validate. * @param \Symfony\Component\HttpFoundation\Request $request * The request containing info about what to validate. * * @return bool * FALSE if the response failed validation, otherwise TRUE. */
Home | Imprint | This part of the site doesn't use cookies.