function JsonApiRequestValidator::getSubscribedEvents

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/EventSubscriber/JsonApiRequestValidator.php \Drupal\jsonapi\EventSubscriber\JsonApiRequestValidator::getSubscribedEvents()
  2. 8.9.x core/modules/jsonapi/src/EventSubscriber/JsonApiRequestValidator.php \Drupal\jsonapi\EventSubscriber\JsonApiRequestValidator::getSubscribedEvents()
  3. 11.x core/modules/jsonapi/src/EventSubscriber/JsonApiRequestValidator.php \Drupal\jsonapi\EventSubscriber\JsonApiRequestValidator::getSubscribedEvents()

File

core/modules/jsonapi/src/EventSubscriber/JsonApiRequestValidator.php, line 110

Class

JsonApiRequestValidator
Subscriber that validates the query parameter names on a JSON:API request.

Namespace

Drupal\jsonapi\EventSubscriber

Code

public static function getSubscribedEvents() : array {
  $events[KernelEvents::REQUEST][] = [
    'onRequest',
  ];
  // Run before the resource response subscriber (priority 128), so that said
  // subscriber gets the cacheable metadata from this one.
  $events[KernelEvents::RESPONSE][] = [
    'onResponse',
    129,
  ];
  return $events;
}

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