Issue #3620465: Add the endpoint configuration entity

A structure says what a response is made of. This says that the response exists at all - which kind of resource, over which bundle, at which path, by which structure - and it is written down before the generator writes the class.

It has three readers rather than one: the generator, which turns it into a plugin; the change queue, which compares what is described with what the site now has; and a person, who should be able to see what their API consists of without reading generated PHP.

The kinds are a closed list, one per base class the module ships, and the list lives on the entity rather than in the generator: a kind nobody can build has to be refused when somebody writes it down, not when the generator runs and finds it.

Three more refusals on save, each of a bug that would otherwise be found later and further away - a structure that does not exist, a path another endpoint already answers at, and a plugin ID another endpoint already is. Placeholders do not count as different: two endpoints at "/get-node/{node}" and "/get-node/{entity}" are one route, and Drupal would silently keep one.

A flag says whether the generator owns the endpoint, so that a handwritten one can be described without being rewritten. Status switches an endpoint off without throwing its description away.

Closes #3620465

Merge request reports

Loading
Loading