Issue #3620337: Add the computed shapes for keys that are not fields

Part of every response is not a field: the id, the label, the address, the timestamps, the translations, the counters a site keeps. They are now described the way everything else is, with the shape saying what the value looks like and the source saying where it comes from.

  • Five shapes rather than one per key: entity_key, entity_date, alias, locales and role. The id and the label are both a scalar off the entity; created and changed are both a moment.
  • MyrestComputedShapeBase for a shape whose source is not a field.
  • The keys are asked of the entity type definition, so a structure that says "label" finds a node's title and a term's name, and the address comes from the canonical route rather than from an id pasted after "/node/".
  • MyrestMomentTrait and MyrestEntityUrlTrait keep the pair a date is answered with and the address of a page from drifting between the shapes that build them. The date shape moves onto the first of the two.
  • An entity type that does not have the key, and a role a site never filled in, produce no key at all rather than an empty string or a zero.

Closes #3620337

Merge request reports

Loading