Apply ISP on ResourceFieldEnhancerInterface

Created on 17 February 2023, over 1 year ago
Updated 18 June 2024, 10 days ago

(This is a follow-up on a previous Slack conversation.)

Problem/Motivation

Resource field enhancers are valuable additions by this module to JSONAPI, however, the Drupal\jsonapi_extras\Plugin\ResourceFieldEnhancerInterface interface is too big, and it requires too much responsibility from implementations. It depends on smaller interfaces/contracts, so it should be easy to explode and create dedicated plugin interfaces and managers for only transforming or untransforming (or both like now).

The PHP library behind the scenes β†’ already has ISP implemented and it allows to perform one-way transformations (like only manipulating the input) instead of building data adaptors always (which has its own challenges, see 🌱 Refactor field enhancer schema generation Active ).

Steps to reproduce

Proposed resolution

Introduce dedicated plugins and plugin managers for manipulating input and output data (or both).

Remaining tasks

User interface changes

API changes

New APIs are gonna be introduced, the existing one probably gets deprecated.

Data model changes

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary mxr576 Hungary

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024