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 559f3bd5a4bc..bd2cae073e51 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php @@ -211,6 +211,14 @@ protected function getOutputFormat(string $accept, array $produced): ?string return 'application/xml'; } + if (in_array('application/pdf', $accept) && in_array('application/pdf', $produced)) { + return 'application/pdf'; + } + + if (in_array('image/png', $accept) && in_array('image/png', $produced)) { + return 'image/png'; + } + // If we reach this point, we don't have a common ground between server and client return null; }