serialization.services.yml

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

Services

Title Deprecated Summary
Drupal\serialization\EntityResolver\ChainEntityResolverInterface
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
_defaults

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