You are here

public function ResourceResponseValidator::doValidateResponse in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/EventSubscriber/ResourceResponseValidator.php \Drupal\jsonapi\EventSubscriber\ResourceResponseValidator::doValidateResponse()
  2. 9 core/modules/jsonapi/src/EventSubscriber/ResourceResponseValidator.php \Drupal\jsonapi\EventSubscriber\ResourceResponseValidator::doValidateResponse()

Wraps validation in an assert to prevent execution in production.

See also

self::validateResponse

File

core/modules/jsonapi/src/EventSubscriber/ResourceResponseValidator.php, line 116

Class

ResourceResponseValidator
Response subscriber that validates a JSON:API response.

Namespace

Drupal\jsonapi\EventSubscriber

Code

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');
}