diff --git a/core/modules/rest/src/Plugin/views/display/RestExport.php b/core/modules/rest/src/Plugin/views/display/RestExport.php index 0cd43e9..8af1a75 100644 --- a/core/modules/rest/src/Plugin/views/display/RestExport.php +++ b/core/modules/rest/src/Plugin/views/display/RestExport.php @@ -278,7 +278,7 @@ public function execute() { $header = []; $header['Content-type'] = $this->getMimeType(); - $response = new CacheableResponse($output['#markup'], 200); + $response = new CacheableResponse($this->renderer->renderRoot($output), 200); $cache_metadata = CacheableMetadata::createFromRenderArray($output); $response->addCacheableDependency($cache_metadata); diff --git a/core/modules/rest/src/Plugin/views/style/Serializer.php b/core/modules/rest/src/Plugin/views/style/Serializer.php index ac41a00..6078c9f 100644 --- a/core/modules/rest/src/Plugin/views/style/Serializer.php +++ b/core/modules/rest/src/Plugin/views/style/Serializer.php @@ -132,8 +132,7 @@ public function render() { $content_type = $this->options['formats'] ? reset($this->options['formats']) : 'json'; } - $output = $this->serializer->serialize($rows, $content_type); - return $output; + return $this->serializer->serialize($rows, $content_type); } /**