Problem/Motivation

Part of every response is not a field at all: the alias, the label, the created and changed timestamps, the metatags, the available translations, the view and like counters, the reading time. They are computed from the entity or from the environment, and today they are assembled inline in each resource.

Proposed resolution

  • Express each as a shape with a source of id, label, alias, created, changed, locales, metatags rather than a field name, so a structure describes them the same way it describes everything else.
  • Take the entity keys from the entity type definition, so that the computed keys work for any content entity type.
  • The ones that depend on a site-filled role — counters, reading time, metatags source — return nothing at all when the role is unfilled.
  • Alias and locales must work for entity types whose canonical route is not /node/{id}.

Remaining tasks

Everything.

Issue fork myrest-3620337

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 7f524fe8 on 1.0.x
    Issue #3620337: Add the computed shapes for keys that are not fields
    
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)