-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Enable json_decode_detailed_errors
in dev by default
#51215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
use Doctrine\Common\Annotations\Annotation; | ||
use Doctrine\DBAL\Connection; | ||
use Psr\Log\LogLevel; | ||
use Seld\JsonLint\JsonParser; | ||
use Symfony\Bundle\FullStack; | ||
use Symfony\Component\Asset\Package; | ||
use Symfony\Component\AssetMapper\AssetMapper; | ||
|
@@ -41,6 +42,7 @@ | |
use Symfony\Component\RemoteEvent\RemoteEvent; | ||
use Symfony\Component\Scheduler\Schedule; | ||
use Symfony\Component\Semaphore\Semaphore; | ||
use Symfony\Component\Serializer\Encoder\JsonDecode; | ||
use Symfony\Component\Serializer\Serializer; | ||
use Symfony\Component\Translation\Translator; | ||
use Symfony\Component\Uid\Factory\UuidFactory; | ||
|
@@ -1123,6 +1125,10 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e | |
->arrayNode('default_context') | ||
->normalizeKeys(false) | ||
->useAttributeAsKey('name') | ||
->beforeNormalization() | ||
->ifTrue(fn () => $this->debug && class_exists(JsonParser::class)) | ||
->then(fn (array $v) => $v + [JsonDecode::DETAILED_ERROR_MESSAGES => true]) | ||
->end() | ||
->defaultValue([]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the default value should probably also include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see #57804 |
||
->prototype('variable')->end() | ||
->end() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding that default in
beforeNormalization
makes it very hard to re-disable the feature because each source will re-enable it in this normalization (well, each source configuring thedefault_context
).This should be done in the
validate
phase instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #57803