Download the PHP package hoppinger/rest_normalizations without Composer
On this page you can find all versions of the php package hoppinger/rest_normalizations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hoppinger/rest_normalizations
More information about hoppinger/rest_normalizations
Files in hoppinger/rest_normalizations
Package rest_normalizations
Short Description Drupal module to extend REST resources
License GPL-2.0+
Homepage https://github.com/hoppinger/rest_normalizations
Informations about the package 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
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
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 <target_identifier>
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
The filename must be similar to the module name i.e., ModuleNameServiceProvider.php and must be placed in the src folder.
By default, media, file and paragraph are already added as the target identifiers.