Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CHANGELOG
invokable Kernel class, and register `FrameworkBundle` by default when the `bundles.php` file is missing
* [BC BREAK] The `secrets:decrypt-to-local` command terminates with a non-zero exit code when a secret could not be read
* Deprecate making `cache.app` adapter taggable, use the `cache.app.taggable` adapter instead
* Enable `json_decode_detailed_errors` in the default serializer context in debug mode by default when `seld/jsonlint` is installed

7.1
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,10 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e
->prototype('variable')->end()
->end()
->end()
->validate()
->ifTrue(fn ($v) => $this->debug && class_exists(JsonParser::class) && !isset($v['default_context'][JsonDecode::DETAILED_ERROR_MESSAGES]))
->then(function ($v) { $v['default_context'][JsonDecode::DETAILED_ERROR_MESSAGES] = true; return $v; })
->end()
->end()
->end()
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,30 @@ public function testScopedHttpClientsInheritRateLimiterAndRetryFailedConfigurati
$this->assertSame(999, $scopedClients['qux']['retry_failed']['delay']);
}

public function testSerializerJsonDetailedErrorMessagesEnabledByDefaultWithDebugEnabled()
{
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(true), [
[
'serializer' => null,
],
]);

$this->assertSame([JsonDecode::DETAILED_ERROR_MESSAGES => true], $config['serializer']['default_context'] ?? []);
}

public function testSerializerJsonDetailedErrorMessagesNotSetByDefaultWithDebugDisabled()
{
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(false), [
[
'serializer' => null,
],
]);

$this->assertSame([], $config['serializer']['default_context'] ?? []);
}

protected static function getBundleDefaultConfig()
{
return [
Expand Down