-
-
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
[FrameworkBundle] Enable json_decode_detailed_errors
in dev by default
#51215
Conversation
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
2a551c2
to
4939f03
Compare
4939f03
to
b595e90
Compare
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.
This works because performNoDeepMerging is not set on the node, OK.
Thank you @ostrolucky. |
@@ -1123,6 +1125,10 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e | |||
->arrayNode('default_context') | |||
->normalizeKeys(false) | |||
->useAttributeAsKey('name') | |||
->beforeNormalization() |
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 the default_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
->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 comment
The reason will be displayed to describe this comment to others. Learn more.
the default value should probably also include JsonDecode::DETAILED_ERROR_MESSAGES => true
(when appropriate) so that this configuration also applies when no default_context is configured at all.
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 #57804
… to the validate phase (xabbuh) This PR was merged into the 6.4 branch. Discussion ---------- [FrameworkBundle] move adding detailed JSON error messages to the validate phase | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #51215 (comment) | License | MIT Commits ------- b9258df move adding detailed JSON error messages to the validate phase
…fault when debug enabled (xabbuh) This PR was merged into the 7.2 branch. Discussion ---------- [FrameworkBundle] enable detailed error messages by default when debug enabled | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix #51215 (comment) | License | MIT Commits ------- 0134a67 [FrameworkBundle] enable detailed error messages by default when debug enabled
Follows