JSON:API's entity reference field normalizer (Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer
) has been removed. Its service name was serializer.normalizer.entity_reference_field.jsonapi
.
It has been replaced by Drupal\jsonapi\Normalizer\RelationshipNormalizer
in order to lay the foundation for relationships between resources that are not constrained by what entity reference fields require (f.e. that referenced entities all be of the same type).
Internally, JSON:API now converts entity reference fields to relationship objects with a pattern similar to: Drupal\jsonapi\JsonApiResource\Relationship::createFromEntityReferenceField($entity->field_entity_reference)
. This relationship object can then be normalized by the newly added normalizer.
Both the removed normalizer and the new normalizer are internal to JSON:API's normalization system and should not be injected, extended, overridden, decorated or depended upon by any other module.