function JsonApiRequestValidator::onRequest

Validates JSON:API requests.

Parameters

\Symfony\Component\HttpKernel\Event\RequestEvent $event: The event to process.

File

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

Class

JsonApiRequestValidator
Request subscriber that validates a JSON:API request.

Namespace

Drupal\jsonapi\EventSubscriber

Code

public function onRequest(RequestEvent $event) {
  $request = $event->getRequest();
  if ($request->getRequestFormat() !== 'api_json') {
    return;
  }
  $this->validateQueryParams($request);
}

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