Serialization API overview
The Serialization API is new in Drupal 8. It is largely based on the Symfony Serializer component, so their documentation is also relevant.
How the Serializer works
The Serialization API depends on Symfony's Serializer component.
Adding new formats
Core supports JSON and XML, as well as HAL-JSON. It is easy to add support for other formats.
Changing the way Serializer handles entities
Core supports serialization for content entities, their fields, and field items. It is easy to add support for other classes, and also to
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.