Problem/Motivation

The single most common endpoint — one entity of one bundle, rendered in full — is written by hand once per bundle per site today. In the target architecture it is a base class holding all the behaviour, with a generated subclass that declares three things: the structure, the breadcrumb trail and the counter field.

Proposed resolution

  • MyrestEntityDetailResourceBase: load by id or by alias, check access, resolve the translation, build through the structure, attach cache metadata, wrap in the envelope, handle the not-found and access-denied cases through the existing error envelope.
  • Declarative hooks for the subclass — structure id, breadcrumb trail, counter field — and nothing else; no branch may live in a subclass.
  • Works for any content entity type.
  • Functional coverage against a fixture bundle, including a missing entity, an unpublished one and a translation that does not exist.

Remaining tasks

Everything.

Issue fork myrest-3620646

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 4a7ca3e2 on 1.0.x
    Issue #3620646: Add the entity detail resource base class
    
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)