Serialization API

Serialization API in Drupal 8.

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

Guide maintainers