serializer.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" ?>
  2. <container xmlns="http://symfony.com/schema/dic/services"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  5. <parameters>
  6. <parameter key="serializer.class">Symfony\Component\Serializer\Serializer</parameter>
  7. <parameter key="serializer.encoder.xml.class">Symfony\Component\Serializer\Encoder\XmlEncoder</parameter>
  8. <parameter key="serializer.encoder.json.class">Symfony\Component\Serializer\Encoder\JsonEncoder</parameter>
  9. <parameter key="serializer.mapping.cache.prefix" />
  10. </parameters>
  11. <services>
  12. <service id="serializer" class="%serializer.class%">
  13. <argument type="collection" />
  14. <argument type="collection" />
  15. </service>
  16. <service id="serializer.property_accessor" alias="property_accessor" public="false" />
  17. <!-- Normalizer -->
  18. <service id="serializer.normalizer.object" class="Symfony\Component\Serializer\Normalizer\ObjectNormalizer" public="false">
  19. <argument type="service" id="serializer.mapping.class_metadata_factory" />
  20. <argument>null</argument> <!-- name converter -->
  21. <argument type="service" id="serializer.property_accessor" />
  22. <!-- Run after all custom serializers -->
  23. <tag name="serializer.normalizer" priority="-1000" />
  24. </service>
  25. <!-- Loader -->
  26. <service id="serializer.mapping.chain_loader" class="Symfony\Component\Serializer\Mapping\Loader\LoaderChain" public="false">
  27. <argument type="collection" />
  28. </service>
  29. <!-- Class Metadata Factory -->
  30. <service id="serializer.mapping.class_metadata_factory" class="Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory" public="false">
  31. <argument type="service" id="serializer.mapping.chain_loader" />
  32. <argument>null</argument>
  33. </service>
  34. <!-- Cache -->
  35. <service id="serializer.mapping.cache.apc" class="Doctrine\Common\Cache\ApcCache" public="false">
  36. <call method="setNamespace">
  37. <argument>%serializer.mapping.cache.prefix%</argument>
  38. </call>
  39. </service>
  40. <!-- Encoders -->
  41. <service id="serializer.encoder.xml" class="%serializer.encoder.xml.class%" public="false">
  42. <tag name="serializer.encoder" />
  43. </service>
  44. <service id="serializer.encoder.json" class="%serializer.encoder.json.class%" public="false">
  45. <tag name="serializer.encoder" />
  46. </service>
  47. <!-- Name converter -->
  48. <service id="serializer.name_converter.camel_case_to_snake_case" class="Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter" public="false" />
  49. </services>
  50. </container>