Problem/Motivation

Part of what the module returns cannot be derived from the content model: which field is the view counter, which node holds the page variables, what the breadcrumb trail of an article is, which bundle holds reviews. These are named roles the site fills in, and hardcoding them is what makes the current module unusable on any site but the one it was written for.

Proposed resolution

  • A myrest_conventions configuration entity per entity type and bundle, holding the roles a response needs a site to name: dynamic_data, view_counter, like_counter, special_pages, breadcrumbs, static_data, facets, reviews_rating, reading_time, metatags.
  • A service that answers "is this role filled, and with what" and is the only way the rest of the code asks — no direct configuration reads scattered around.
  • Each filled role records who confirmed it and when, because a role filled by a person and a role filled by a guess must be distinguishable.
  • An unfilled role is a normal state: the service returns nothing, the response has no such key, and hook_requirements says nothing about it.
  • A closed set of roles — a new role is a code change and a new issue, not a free-form key.

Remaining tasks

Everything. The mechanism that suggests values for these roles is filed separately; this issue is the storage and the contract.

Issue fork myrest-3620605

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 d63b0111 on 1.0.x
    Issue #3620605: Add the configuration entity for the roles a site fills...
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)