Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This module provides a user-friendly way to define how entity data is structured for output, allowing you to customize the JSON representation of nodes, users, and other entities using YAML files. It offers features like grouping fields, adding custom data, and creating different output formats without writing custom code.

This module makes it really easy to normalize the nodes in a more useful way than Drupal does by default. You can define the output of each entity type (like nodes, users, terms, etc.) per bundle using YAML files instead of creating everything in code.

Some of the key features are:

  • Define output in readable YAML files.
  • Extend definitions: create basic and bundle specific definitions.
  • Different definitions per normalization format.
  • Combine fields in groups without writing code.
  • Add custom data to the output using 'pseudo' fields.
  • Easy chaining of simple normalizers.

Configuration

Use RestUI (or code) to enable the JSON (or another) output format for content so you can fetch nodes using a url like /node/1?_format=json.

After this, you can configure the JSON output of entities using YAML files in the
root of your module using the pattern:

<module_name>.entity_normalization.yml

Example

user.base:
  type: user
  bundle: user
  fields:
    uid:
      name: id
    name:

article.base:
  type: node
  bundle: [article]
  fields:
    nid:
      name: id
    url:
      type: pseudo
      normalizer: entity_url.normalizer
    title:
    uid:
      name: author

This definition will give the following output when calling "/article/1234/my-title.html?_format=json":

{
  "id": 1234,
  "url": "/article/1234/my-title.html",
  "title": "My Title",
  "author": {
    "id": 1,
    "name": "Administrator"
  }
}

Depends on

Dependencies of the latest stable release

  • serialization Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2025
Latest release
11 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
3.0.0 Stable 10–11 Sep 16, 2025