enable property info

This commit is contained in:
David Badura 2016-07-26 16:19:03 +02:00 committed by Nicolas Grekas
parent 90e95a605f
commit c02933dba3
5 changed files with 5 additions and 0 deletions

View File

@ -21,6 +21,7 @@
<argument type="service" id="serializer.mapping.class_metadata_factory" />
<argument>null</argument> <!-- name converter -->
<argument type="service" id="serializer.property_accessor" />
<argument type="service" id="property_info" on-invalid="ignore" />
<!-- Run after all custom serializers -->
<tag name="serializer.normalizer" priority="-1000" />

View File

@ -68,6 +68,7 @@ $container->loadFromExtension('framework', array(
'enable_annotations' => true,
'name_converter' => 'serializer.name_converter.camel_case_to_snake_case',
),
'property_info' => true,
'ide' => 'file%%link%%format',
'request' => array(
'formats' => array(

View File

@ -41,5 +41,6 @@
<framework:validation enabled="true" cache="validator.mapping.cache.doctrine.apc" />
<framework:annotations cache="file" debug="true" file-cache-dir="%kernel.cache_dir%/annotations" />
<framework:serializer enabled="true" enable-annotations="true" name-converter="serializer.name_converter.camel_case_to_snake_case" />
<framework:property-info />
</framework:config>
</container>

View File

@ -53,6 +53,7 @@ framework:
enabled: true
enable_annotations: true
name_converter: serializer.name_converter.camel_case_to_snake_case
property_info: ~
ide: file%%link%%format
request:
formats:

View File

@ -462,6 +462,7 @@ abstract class FrameworkExtensionTest extends TestCase
$this->assertEquals('Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader', $argument[0]->getClass());
$this->assertNull($container->getDefinition('serializer.mapping.class_metadata_factory')->getArgument(1));
$this->assertEquals(new Reference('serializer.name_converter.camel_case_to_snake_case'), $container->getDefinition('serializer.normalizer.object')->getArgument(1));
$this->assertEquals(new Reference('property_info', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE), $container->getDefinition('serializer.normalizer.object')->getArgument(3));
}
public function testRegisterSerializerExtractor()