serialization.services.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. services:
  2. serializer:
  3. class: Symfony\Component\Serializer\Serializer
  4. arguments: [{ }, { }]
  5. serializer.normalizer.config_entity:
  6. class: Drupal\serialization\Normalizer\ConfigEntityNormalizer
  7. tags:
  8. - { name: normalizer }
  9. arguments: ['@entity.manager']
  10. serializer.normalizer.content_entity:
  11. class: Drupal\serialization\Normalizer\ContentEntityNormalizer
  12. tags:
  13. - { name: normalizer }
  14. arguments: ['@entity.manager']
  15. serializer.normalizer.entity:
  16. class: Drupal\serialization\Normalizer\EntityNormalizer
  17. tags:
  18. - { name: normalizer }
  19. arguments: ['@entity.manager']
  20. serializer.normalizer.primitive_data:
  21. class: Drupal\serialization\Normalizer\PrimitiveDataNormalizer
  22. tags:
  23. - { name: normalizer, priority: 5, bc: bc_primitives_as_strings, bc_config_name: 'serialization.settings' }
  24. serializer.normalizer.complex_data:
  25. class: Drupal\serialization\Normalizer\ComplexDataNormalizer
  26. tags:
  27. - { name: normalizer }
  28. serializer.normalizer.entity_reference_field_item:
  29. class: Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer
  30. tags:
  31. # Set the priority lower than the hal entity reference field item
  32. # normalizer, so that we do not replace that for hal_json but higher than
  33. # this modules generic field item normalizer.
  34. # @todo Find a better way for this in https://www.drupal.org/node/2575761.
  35. - { name: normalizer, priority: 8 }
  36. arguments: ['@entity.repository']
  37. serialization.normalizer.field_item:
  38. class: Drupal\serialization\Normalizer\FieldItemNormalizer
  39. tags:
  40. # Priority must be lower than serializer.normalizer.field_item.hal and any
  41. # field type specific normalizer such as
  42. # serializer.normalizer.entity_reference_field_item.
  43. - { name: normalizer, priority: 6 }
  44. serialization.normalizer.field:
  45. class: Drupal\serialization\Normalizer\FieldNormalizer
  46. tags:
  47. # Priority must be lower than serializer.normalizer.field.hal.
  48. - { name: normalizer, priority: 6 }
  49. serializer.normalizer.list:
  50. class: Drupal\serialization\Normalizer\ListNormalizer
  51. tags:
  52. # Priority must be higher than serialization.normalizer.field but less
  53. # than hal field normalizer.
  54. - { name: normalizer, priority: 9 }
  55. serializer.normalizer.timestamp_item:
  56. class: Drupal\serialization\Normalizer\TimestampItemNormalizer
  57. tags:
  58. # Priority must be higher than serializer.normalizer.field_item and lower
  59. # than hal normalizers.
  60. - { name: normalizer, priority: 8, bc: bc_timestamp_normalizer_unix, bc_config_name: 'serialization.settings' }
  61. serializer.normalizer.password_field_item:
  62. class: Drupal\serialization\Normalizer\NullNormalizer
  63. arguments: ['Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem']
  64. tags:
  65. - { name: normalizer, priority: 20 }
  66. serializer.normalizer.safe_string:
  67. class: Drupal\serialization\Normalizer\MarkupNormalizer
  68. tags:
  69. - { name: normalizer }
  70. serializer.normalizer.typed_data:
  71. class: Drupal\serialization\Normalizer\TypedDataNormalizer
  72. tags:
  73. - { name: normalizer }
  74. serializer.encoder.json:
  75. class: Drupal\serialization\Encoder\JsonEncoder
  76. tags:
  77. - { name: encoder, format: json }
  78. serializer.encoder.xml:
  79. class: Drupal\serialization\Encoder\XmlEncoder
  80. tags:
  81. - { name: encoder, format: xml }
  82. serializer.entity_resolver:
  83. class: Drupal\serialization\EntityResolver\ChainEntityResolver
  84. serializer.entity_resolver.uuid:
  85. class: Drupal\serialization\EntityResolver\UuidResolver
  86. tags:
  87. - { name: entity_resolver}
  88. arguments: ['@entity.repository']
  89. serialization.entity_resolver.target_id:
  90. class: Drupal\serialization\EntityResolver\TargetIdResolver
  91. tags:
  92. - { name: entity_resolver}
  93. serialization.exception.default:
  94. class: Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber
  95. tags:
  96. - { name: event_subscriber }
  97. arguments: ['@serializer', '%serializer.formats%']
  98. serialization.user_route_alter_subscriber:
  99. class: Drupal\serialization\EventSubscriber\UserRouteAlterSubscriber
  100. tags:
  101. - { name: event_subscriber }
  102. arguments: ['%serializer.formats%']
  103. serialization.bc_config_subscriber:
  104. class: Drupal\serialization\EventSubscriber\BcConfigSubscriber
  105. tags:
  106. - { name: event_subscriber }
  107. arguments: ['@kernel']