serialization.services.yml 2.44 KB
Newer Older
1 2 3 4
services:
  serializer:
    class: Symfony\Component\Serializer\Serializer
    arguments: [{  }, {  }]
5 6 7 8 9
  serializer.normalizer.config_entity:
    class: Drupal\serialization\Normalizer\ConfigEntityNormalizer
    tags:
      - { name: normalizer }
    arguments: ['@entity.manager']
10 11 12 13 14
  serializer.normalizer.content_entity:
      class: Drupal\serialization\Normalizer\ContentEntityNormalizer
      tags:
        - { name: normalizer }
      arguments: ['@entity.manager']
15 16 17 18 19
  serializer.normalizer.entity:
    class: Drupal\serialization\Normalizer\EntityNormalizer
    tags:
      - { name: normalizer }
    arguments: ['@entity.manager']
20 21 22 23
  serializer.normalizer.complex_data:
    class: Drupal\serialization\Normalizer\ComplexDataNormalizer
    tags:
      - { name: normalizer }
24 25 26
  serializer.normalizer.entity_reference_field_item:
    class: Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer
    tags:
27 28 29 30
      # Set the priority lower than the hal entity reference field item
      # normalizer, so that we do not replace that for hal_json.
      # @todo Find a better way for this in https://www.drupal.org/node/2575761.
      - { name: normalizer, priority: 5 }
31 32 33 34
  serializer.normalizer.list:
    class: Drupal\serialization\Normalizer\ListNormalizer
    tags:
      - { name: normalizer }
35 36 37 38 39
  serializer.normalizer.password_field_item:
      class: Drupal\serialization\Normalizer\NullNormalizer
      arguments: ['Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem']
      tags:
        - { name: normalizer, priority: 20 }
40
  serializer.normalizer.safe_string:
41
      class: Drupal\serialization\Normalizer\MarkupNormalizer
42 43
      tags:
        - { name: normalizer }
44 45 46 47 48 49 50 51 52 53 54 55
  serializer.normalizer.typed_data:
    class: Drupal\serialization\Normalizer\TypedDataNormalizer
    tags:
      - { name: normalizer }
  serializer.encoder.json:
    class: Drupal\serialization\Encoder\JsonEncoder
    tags:
      - { name: encoder, format: json }
  serializer.encoder.xml:
    class: Drupal\serialization\Encoder\XmlEncoder
    tags:
      - { name: encoder, format: xml }
56 57 58 59 60 61
  serializer.entity_resolver:
    class: Drupal\serialization\EntityResolver\ChainEntityResolver
  serializer.entity_resolver.uuid:
    class: Drupal\serialization\EntityResolver\UuidResolver
    tags:
      - { name: entity_resolver}
62
    arguments: ['@entity.manager']
63 64 65 66
  serialization.entity_resolver.target_id:
    class: Drupal\serialization\EntityResolver\TargetIdResolver
    tags:
      - { name: entity_resolver}