PHPackages                             hoppinger/rest\_normalizations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hoppinger/rest\_normalizations

ActiveDrupal-module[API Development](/categories/api)

hoppinger/rest\_normalizations
==============================

Drupal module to extend REST resources

1.9.2(3y ago)318.5k↓20%1[1 issues](https://github.com/hoppinger/rest_normalizations/issues)[1 PRs](https://github.com/hoppinger/rest_normalizations/pulls)GPL-2.0+PHP

Since Aug 6Pushed 4mo ago4 watchersCompare

[ Source](https://github.com/hoppinger/rest_normalizations)[ Packagist](https://packagist.org/packages/hoppinger/rest_normalizations)[ Docs](https://github.com/hoppinger/rest_normalizations)[ RSS](/packages/hoppinger-rest-normalizations/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)DependenciesVersions (34)Used By (0)

Rest Normalizations
===================

[](#rest-normalizations)

The Rest Normalizations module for Drupal 8 extends the default Drupal 8 normalizations for the REST API. It adds properties that are helpful in a headless architecture and helps with embedding sub-entities in entities.

Installation
------------

[](#installation)

```
composer require hoppinger/rest_normalizations
```

Version compatibiliy
--------------------

[](#version-compatibiliy)

Version 1.4.0 and up are only compatible with Drupal 8.7.0 and up, and older versions are not compatible with Drupal 8.7.0 and up.

Usage
-----

[](#usage)

Rest Normalization module helps to embed the entity referenced in the content, by altering the REST API.

For example, The Entity reference field in the REST Output provides the target\_id, target\_type and URI. In some cases, we need more data regarding the referenced entity other than the provided data. Rest Normalization helps to solve this problem by overriding the default values and embedding the entity data into the response.

Create a .php file in the module directory /src with the following content. Replace the `` with the project-specific entity reference field that needs to be embedded into the API response (for example: `node-story_overview-field_featured_story`)

The &lt;target\_identifiers&gt; can be entityreference fields, Paragraphs, File, Image, Video, Media, Taxonomyreference field.

The filename must be similar to the module name i.e., ModuleNameServiceProvider.php and must be placed in the src folder.

```
namespace Drupal\module_name;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Symfony\Component\DependencyInjection\Reference;

class ModuleNameServiceProvider extends ServiceProviderBase {
  public function alter(ContainerBuilder $container) {
    if ($container->hasParameter('rest_normalizations.target_identifiers')) {
      $target_identifiers = $container->getParameter('rest_normalizations.target_identifiers');

      $target_identifiers[] = ; #e.g., node-story_overview-field_featured_story

      $container->setParameter('rest_normalizations.target_identifiers', $target_identifiers);
  }
}
```

By default, media, file and paragraph are already added as the target identifiers.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance45

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 62.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~106 days

Recently: every ~204 days

Total

27

Last Release

123d ago

Major Versions

1.9.2 → 10.1.x-dev2023-10-27

9.x-dev → 10.x-dev2023-12-08

10.2.x-dev → 11.x-dev2025-09-14

PHP version history (3 changes)10.1.x-devPHP &gt;=8.1

9.1.x-devPHP &gt;=7.3

11.x-devPHP &gt;=8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23648809?v=4)[Ashwini Mone](/maintainers/ashwinimone)[@ashwinimone](https://github.com/ashwinimone)

![](https://avatars.githubusercontent.com/u/10885177?v=4)[Giuseppe Maggiore](/maintainers/giuseppemag)[@giuseppemag](https://github.com/giuseppemag)

![](https://avatars.githubusercontent.com/u/5929758?v=4)[Amit Ajgaonkar](/maintainers/amitajgaonkar)[@amitajgaonkar](https://github.com/amitajgaonkar)

---

Top Contributors

[![rolfvandekrol](https://avatars.githubusercontent.com/u/434397?v=4)](https://github.com/rolfvandekrol "rolfvandekrol (25 commits)")[![ashwinimone](https://avatars.githubusercontent.com/u/23648809?v=4)](https://github.com/ashwinimone "ashwinimone (9 commits)")[![WimJongeneel](https://avatars.githubusercontent.com/u/14921418?v=4)](https://github.com/WimJongeneel "WimJongeneel (3 commits)")[![EDeijl](https://avatars.githubusercontent.com/u/2330187?v=4)](https://github.com/EDeijl "EDeijl (2 commits)")[![florisdegraaff](https://avatars.githubusercontent.com/u/15651945?v=4)](https://github.com/florisdegraaff "florisdegraaff (1 commits)")

### Embed Badge

![Health badge](/badges/hoppinger-rest-normalizations/health.svg)

```
[![Health](https://phpackages.com/badges/hoppinger-rest-normalizations/health.svg)](https://phpackages.com/packages/hoppinger-rest-normalizations)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
