Skip to content

Commit 1f2458c

Browse files
authored
Merge pull request #629 from dunglas/enable_json
Enable JSON to have Swagger support by default
2 parents 91dc2a4 + 5a78f00 commit 1f2458c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function getConfigTreeBuilder()
6868
->end()
6969
->end();
7070

71-
$this->addFormatSection($rootNode, 'formats', ['jsonld' => ['mime_types' => ['application/ld+json']]]);
71+
$this->addFormatSection($rootNode, 'formats', [
72+
'jsonld' => ['mime_types' => ['application/ld+json']],
73+
'json' => ['mime_types' => ['application/json']], // Enabled by default to have Swagger support
74+
]);
7275
$this->addFormatSection($rootNode, 'error_formats', [
7376
'jsonproblem' => ['mime_types' => ['application/problem+json']],
7477
'jsonld' => ['mime_types' => ['application/ld+json']],

tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ public function testDefaultConfig()
3434
'title' => 'title',
3535
'description' => 'description',
3636
'version' => '1.0.0',
37-
'formats' => ['jsonld' => ['mime_types' => ['application/ld+json']]],
37+
'formats' => [
38+
'jsonld' => ['mime_types' => ['application/ld+json']],
39+
'json' => ['mime_types' => ['application/json']],
40+
],
3841
'error_formats' => [
3942
'jsonproblem' => ['mime_types' => ['application/problem+json']],
4043
'jsonld' => ['mime_types' => ['application/ld+json']],

0 commit comments

Comments
 (0)