public function HttpExceptionNormalizer::normalize in Drupal 9
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/Normalizer/HttpExceptionNormalizer.php \Drupal\jsonapi\Normalizer\HttpExceptionNormalizer::normalize()
File
- core/
modules/ jsonapi/ src/ Normalizer/ HttpExceptionNormalizer.php, line 51
Class
- HttpExceptionNormalizer
- Normalizes an HttpException in compliance with the JSON:API specification.
Namespace
Drupal\jsonapi\NormalizerCode
public function normalize($object, $format = NULL, array $context = []) {
$cacheability = new CacheableMetadata();
$cacheability
->addCacheableDependency($object);
return new HttpExceptionNormalizerValue($cacheability, static::rasterizeValueRecursive($this
->buildErrorObjects($object)));
}