Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Add route discovery based on type #578

@danielbachhuber

Description

@danielbachhuber

As a core endpoint author, I'd like to be able to embed a reference to a User (e.g. author) from my Post.

Currently, this relationship is strongly coupled:

// Entity meta
$links = array(
        'self'       => array(
                'href' => json_url( '/posts/' . $post['ID'] ),
        ),
        'author'     => array(
                'href' => json_url( '/users/' . $post['post_author'] ),
        ),
        'collection' => array(
                'href' => json_url( '/posts' ),
        ),
);

My Post Resource shouldn't need to know of the route to the User Resource. My Post Resource be able to return the relationship in a structured manner, and have the Server resolve the proper route.

Related #559, #577

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions