serialization.services.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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_type.manager', '@entity_type.repository', '@entity_field.manager']
  10. serializer.normalizer.content_entity:
  11. class: Drupal\serialization\Normalizer\ContentEntityNormalizer
  12. tags:
  13. - { name: normalizer }
  14. arguments: ['@entity_type.manager', '@entity_type.repository', '@entity_field.manager']
  15. serializer.normalizer.entity:
  16. class: Drupal\serialization\Normalizer\EntityNormalizer
  17. tags:
  18. - { name: normalizer }
  19. arguments: ['@entity_type.manager', '@entity_type.repository', '@entity_field.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.timestamp:
  62. class: Drupal\serialization\Normalizer\TimestampNormalizer
  63. arguments: ['@config.factory']
  64. tags:
  65. # Priority must be higher than serializer.normalizer.primitive_data.
  66. - { name: normalizer, priority: 20, bc: bc_timestamp_normalizer_unix, bc_config_name: 'serialization.settings' }
  67. serializer.normalizer.datetimeiso8601:
  68. class: \Drupal\serialization\Normalizer\DateTimeIso8601Normalizer
  69. arguments: ['@config.factory']
  70. tags:
  71. # Priority must be higher than serializer.normalizer.primitive_data.
  72. - { name: normalizer, priority: 20 }
  73. serializer.normalizer.password_field_item:
  74. class: Drupal\serialization\Normalizer\NullNormalizer
  75. arguments: ['Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem']
  76. tags:
  77. - { name: normalizer, priority: 20 }
  78. serializer.normalizer.safe_string:
  79. class: Drupal\serialization\Normalizer\MarkupNormalizer
  80. tags:
  81. - { name: normalizer }
  82. serializer.normalizer.typed_data:
  83. class: Drupal\serialization\Normalizer\TypedDataNormalizer
  84. tags:
  85. - { name: normalizer }
  86. serializer.encoder.json:
  87. class: Drupal\serialization\Encoder\JsonEncoder
  88. tags:
  89. - { name: encoder, format: json }
  90. serializer.encoder.xml:
  91. class: Drupal\serialization\Encoder\XmlEncoder
  92. tags:
  93. - { name: encoder, format: xml }
  94. serializer.entity_resolver:
  95. class: Drupal\serialization\EntityResolver\ChainEntityResolver
  96. serializer.entity_resolver.uuid:
  97. class: Drupal\serialization\EntityResolver\UuidResolver
  98. tags:
  99. - { name: entity_resolver}
  100. arguments: ['@entity.repository']
  101. serialization.entity_resolver.target_id:
  102. class: Drupal\serialization\EntityResolver\TargetIdResolver
  103. tags:
  104. - { name: entity_resolver}
  105. serialization.exception.default:
  106. class: Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber
  107. tags:
  108. - { name: event_subscriber }
  109. arguments: ['@serializer', '%serializer.formats%']
  110. serialization.user_route_alter_subscriber:
  111. class: Drupal\serialization\EventSubscriber\UserRouteAlterSubscriber
  112. tags:
  113. - { name: event_subscriber }
  114. arguments: ['%serializer.formats%']
  115. serialization.bc_config_subscriber:
  116. class: Drupal\serialization\EventSubscriber\BcConfigSubscriber
  117. tags:
  118. - { name: event_subscriber }
  119. arguments: ['@kernel']