Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291508

Use definied entity URIs for routes

$
0
0

Problem/Motivation

Currently, REST module creates all entity routes at /entity/{type}/{id}. That rarely matches the HTML-based route. They should match, to be properly RESTful.

Proposed resolution

Now that NG entities can define their own link relations per #1970360: Change notice: Entities should define URI templates and standard links, we can just leverage that. To wit:

1) The URI for an entity should be the "canonical" link the entity defines.
2) The rendered entity, if in a hypermedia-capable format, should include the all of the URI links available for the entity. That is easy to get with a foreach loop and the uri() method of the entity. (See the aforementioned patch.)

Remaining tasks

Let's do it. :-)

User interface changes

None.

API changes

Entity URIs for web services change to what they should be anyway.

#1970360: Change notice: Entities should define URI templates and standard links


Viewing all articles
Browse latest Browse all 291508

Trending Articles