Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

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"
  }
}

Activity

Total releases
1
First release
Sep 2025
Latest release
10 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
3.0.0 Stable Sep 16, 2025