diff --git a/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php b/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php
index 965c149..7fe6520 100644
--- a/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php
+++ b/core/modules/rest/lib/Drupal/rest/EventSubscriber/RouteSubscriber.php
@@ -75,7 +75,7 @@ public function dynamicRoutes(RouteBuildEvent $event) {
           // If there is no format requirement or if it matches the
           // configuration also add the route.
           $format_requirement = $route->getRequirement('_format');
-          if (!$format_requirement || isset($enabled_methods[$method][$format_requirement])) {
+          if (!$format_requirement || empty($method_settings['supportedFormats']) || in_array($format_requirement, $enabled_methods[$method]['supportedFormats']))) {
             $collection->add("rest.$name", $route);
           }
         }
diff --git a/core/modules/rest/lib/Drupal/rest/RequestHandler.php b/core/modules/rest/lib/Drupal/rest/RequestHandler.php
index 904e32b..045f71d 100644
--- a/core/modules/rest/lib/Drupal/rest/RequestHandler.php
+++ b/core/modules/rest/lib/Drupal/rest/RequestHandler.php
@@ -51,8 +51,8 @@ public function handle(Request $request, $id = NULL) {
       // format. If the serializer cannot handle it an exception will be thrown
       // that bubbles up to the client.
       $config = $this->container->get('config.factory')->get('rest.settings')->get('resources');
-      $enabled_formats = $config[$plugin][$request->getMethod()];
-      if (empty($enabled_formats) || isset($enabled_formats[$format])) {
+      $method_settings = $config[$plugin][$request->getMethod()];
+      if (empty($method_settings['supportedFormats']) || in_array($format, $method_settings['supportedFormats'])) {
         $definition = $resource->getPluginDefinition();
         $class = $definition['serialization_class'];
         try {
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
index 808fe2a..6aa1377 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
@@ -195,7 +195,7 @@ protected function enableService($resource_type, $method = 'GET', $format = NULL
     $settings = array();
     if ($resource_type) {
       if ($format) {
-        $settings[$resource_type][$method][$format] = 'TRUE';
+        $settings[$resource_type][$method]['supportedFormats'][] = $format;
       }
       else {
         $settings[$resource_type][$method] = array();
