public function JsonApiRequestValidator::onRequest in Drupal 8
Same name and namespace in other branches
- 9 core/modules/jsonapi/src/EventSubscriber/JsonApiRequestValidator.php \Drupal\jsonapi\EventSubscriber\JsonApiRequestValidator::onRequest()
Validates JSON:API requests.
Parameters
\Symfony\Component\HttpKernel\Event\GetResponseEvent $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\EventSubscriberCode
public function onRequest(GetResponseEvent $event) {
$request = $event
->getRequest();
if ($request
->getRequestFormat() !== 'api_json') {
return;
}
$this
->validateQueryParams($request);
}