diff --git a/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache b/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache index 023b66c90f7..1c3288d813b 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache @@ -204,6 +204,10 @@ class Controller extends AbstractController return 'application/xml'; } + if (in_array('*/*', $accept)) { + return $produced[0]; + } + // If we reach this point, we don't have a common ground between server and client return null; } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php index e21a2f13813..7d2600dbb6e 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php @@ -214,6 +214,10 @@ class Controller extends AbstractController return 'application/xml'; } + if (in_array('*/*', $accept)) { + return $produced[0]; + } + // If we reach this point, we don't have a common ground between server and client return null; }