function ResourceResponseValidator::doValidateResponse

Same name in other branches
  1. 8.9.x 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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.