Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0dea4df

Browse filesBrowse files
xabbuhsymfonyaml
authored and
symfonyaml
committed
move wiring of the property info extractor to the ObjectNormalizer
The PropertyNormalizer does not handle a property info extractor. It looks like the argument was accidentally added to instead of the ObjectNormalizer in symfony#52917.
1 parent 3e416e7 commit 0dea4df
Copy full SHA for 0dea4df

File tree

2 files changed

+9
-7
lines changed
Filter options

2 files changed

+9
-7
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,18 +1854,19 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
18541854
$container->setParameter('serializer.default_context', $defaultContext);
18551855
}
18561856

1857+
$arguments = $container->getDefinition('serializer.normalizer.object')->getArguments();
1858+
$context = [];
1859+
18571860
if (isset($config['circular_reference_handler']) && $config['circular_reference_handler']) {
1858-
$arguments = $container->getDefinition('serializer.normalizer.object')->getArguments();
1859-
$context = ($arguments[6] ?? $defaultContext) + ['circular_reference_handler' => new Reference($config['circular_reference_handler'])];
1861+
$context += ($arguments[6] ?? $defaultContext) + ['circular_reference_handler' => new Reference($config['circular_reference_handler'])];
18601862
$container->getDefinition('serializer.normalizer.object')->setArgument(5, null);
1861-
$container->getDefinition('serializer.normalizer.object')->setArgument(6, $context);
18621863
}
18631864

18641865
if ($config['max_depth_handler'] ?? false) {
1865-
$arguments = $container->getDefinition('serializer.normalizer.object')->getArguments();
1866-
$context = ($arguments[6] ?? $defaultContext) + ['max_depth_handler' => new Reference($config['max_depth_handler'])];
1867-
$container->getDefinition('serializer.normalizer.object')->setArgument(6, $context);
1866+
$context += ($arguments[6] ?? $defaultContext) + ['max_depth_handler' => new Reference($config['max_depth_handler'])];
18681867
}
1868+
1869+
$container->getDefinition('serializer.normalizer.object')->setArgument(6, $context);
18691870
}
18701871

18711872
private function registerPropertyInfoConfiguration(ContainerBuilder $container, PhpFileLoader $loader)

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@
125125
service('property_info')->ignoreOnInvalid(),
126126
service('serializer.mapping.class_discriminator_resolver')->ignoreOnInvalid(),
127127
null,
128+
null,
129+
service('property_info')->ignoreOnInvalid(),
128130
])
129131
->tag('serializer.normalizer', ['priority' => -1000])
130132

@@ -138,7 +140,6 @@
138140
service('serializer.mapping.class_discriminator_resolver')->ignoreOnInvalid(),
139141
null,
140142
[],
141-
service('property_info')->ignoreOnInvalid(),
142143
])
143144

144145
->alias(PropertyNormalizer::class, 'serializer.normalizer.property')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.