Problem/Motivation

A structure — the map from an entity's fields to the keys of a response — has to live somewhere that a human can review, a deployment can carry and an administration form can write. Configuration entities are the mechanism the core provides for exactly that, and they give export, import, diffing in review and translation for free.

Proposed resolution

  • A myrest_structure configuration entity: id, entity type, bundle, and an ordered list of properties, each with a source, a shape and the shape's settings.
  • An interface and a storage service that resolves a structure by id and by bundle, with a static cache.
  • Support for a structure that extends another — a teaser is usually a subset of a detail, and repeating it is how the two drift apart.
  • hook_myrest_structure_alter() — the sanctioned way for a site to change a structure from its own code — invoked after the structure is loaded and before it is built.

Remaining tasks

Everything.

Issue fork myrest-3620444

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sergeydruua created an issue. See original summary.

  • sergeydruua committed 06e49e6f on 1.0.x
    Issue #3620444: Add the structure configuration entity
    
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)