serialization.services.yml

Same filename in other branches
  1. 9 core/modules/serialization/serialization.services.yml
  2. 10 core/modules/serialization/serialization.services.yml
  3. 11.x core/modules/serialization/serialization.services.yml
core/modules/serialization/serialization.services.yml

File

core/modules/serialization/serialization.services.yml

View source
  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']

Services

Title Deprecated Summary
serialization.bc_config_subscriber Drupal\serialization\EventSubscriber\BcConfigSubscriber
serialization.entity_resolver.target_id Drupal\serialization\EntityResolver\TargetIdResolver
serialization.exception.default Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber
serialization.normalizer.field Drupal\serialization\Normalizer\FieldNormalizer
serialization.normalizer.field_item Drupal\serialization\Normalizer\FieldItemNormalizer
serialization.user_route_alter_subscriber Drupal\serialization\EventSubscriber\UserRouteAlterSubscriber
serializer Symfony\Component\Serializer\Serializer
serializer.encoder.json Drupal\serialization\Encoder\JsonEncoder
serializer.encoder.xml Drupal\serialization\Encoder\XmlEncoder
serializer.entity_resolver Drupal\serialization\EntityResolver\ChainEntityResolver
serializer.entity_resolver.uuid Drupal\serialization\EntityResolver\UuidResolver
serializer.normalizer.complex_data Drupal\serialization\Normalizer\ComplexDataNormalizer
serializer.normalizer.config_entity Drupal\serialization\Normalizer\ConfigEntityNormalizer
serializer.normalizer.content_entity Drupal\serialization\Normalizer\ContentEntityNormalizer
serializer.normalizer.datetimeiso8601 \Drupal\serialization\Normalizer\DateTimeIso8601Normalizer
serializer.normalizer.entity Drupal\serialization\Normalizer\EntityNormalizer
serializer.normalizer.entity_reference_field_item Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer
serializer.normalizer.list Drupal\serialization\Normalizer\ListNormalizer
serializer.normalizer.password_field_item Drupal\serialization\Normalizer\NullNormalizer
serializer.normalizer.primitive_data Drupal\serialization\Normalizer\PrimitiveDataNormalizer
serializer.normalizer.safe_string Drupal\serialization\Normalizer\MarkupNormalizer
serializer.normalizer.timestamp Drupal\serialization\Normalizer\TimestampNormalizer
serializer.normalizer.timestamp_item Drupal\serialization\Normalizer\TimestampItemNormalizer
serializer.normalizer.typed_data Drupal\serialization\Normalizer\TypedDataNormalizer

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.