diff --git a/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php b/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php index 0cce2b43974..919ef7bd4e2 100644 --- a/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php +++ b/src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php @@ -68,7 +68,10 @@ public function getConfigTreeBuilder() ->end() ->end(); - $this->addFormatSection($rootNode, 'formats', ['jsonld' => ['mime_types' => ['application/ld+json']]]); + $this->addFormatSection($rootNode, 'formats', [ + 'jsonld' => ['mime_types' => ['application/ld+json']], + 'json' => ['mime_types' => ['application/json']], // Enabled by default to have Swagger support + ]); $this->addFormatSection($rootNode, 'error_formats', [ 'jsonproblem' => ['mime_types' => ['application/problem+json']], 'jsonld' => ['mime_types' => ['application/ld+json']], diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php index 67774365e13..a4e12145023 100644 --- a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php +++ b/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php @@ -34,7 +34,10 @@ public function testDefaultConfig() 'title' => 'title', 'description' => 'description', 'version' => '1.0.0', - 'formats' => ['jsonld' => ['mime_types' => ['application/ld+json']]], + 'formats' => [ + 'jsonld' => ['mime_types' => ['application/ld+json']], + 'json' => ['mime_types' => ['application/json']], + ], 'error_formats' => [ 'jsonproblem' => ['mime_types' => ['application/problem+json']], 'jsonld' => ['mime_types' => ['application/ld+json']],