diff --git a/Routing/RestRouteCollection.php b/Routing/RestRouteCollection.php index a4745bcb9..734de23a6 100644 --- a/Routing/RestRouteCollection.php +++ b/Routing/RestRouteCollection.php @@ -62,7 +62,10 @@ public function prependRouteControllersWithPrefix($prefix) public function setDefaultFormat($format) { foreach (parent::all() as $route) { - $route->setDefault('_format', $format); + // Set default format only if not set already (could be defined in annotation) + if (!$route->getDefault('_format')) { + $route->setDefault('_format', $format); + } } }