diff --git a/core/modules/rest/src/Plugin/views/style/Serializer.php b/core/modules/rest/src/Plugin/views/style/Serializer.php index 4e7c373..128a5e8 100644 --- a/core/modules/rest/src/Plugin/views/style/Serializer.php +++ b/core/modules/rest/src/Plugin/views/style/Serializer.php @@ -128,7 +128,7 @@ public function render() { // Get the content type configured in the display or fallback to the // default. $default_content_type = empty($this->view->live_preview) ? $this->displayHandler->getContentType() : 'json'; - $content_type = $this->options['formats'] ? reset($this->options['formats']) : $default_content_type; + $content_type = isset($this->options['formats'][$default_content_type]) ? $this->options['formats'][$default_content_type] : $default_content_type; return $this->serializer->serialize($rows, $content_type); }