You are here

public function ResourceResponseValidator::doValidateResponse in Drupal 9

Same name and namespace in other branches
  1. 8 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

1 call to ResourceResponseValidator::doValidateResponse()
ResourceResponseValidator::onResponse in core/modules/jsonapi/src/EventSubscriber/ResourceResponseValidator.php
Validates JSON:API responses.

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