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.

Hypermedia #559

@danielbachhuber

Description

@danielbachhuber

Resources should be able to return embedded versions of other resources.

To summarize our current thinking:

  • Callback can convert its return value to WP_JSON_Response and add HAL-compatible links to other resources, as specified by the route.
  • If the request asks for embedded resources, the Server will add embedded representations of the resources to the request by resolving the route (codename Rrrrrrr)
  • "embedded" is a context which returns the bare minimum of public data.

At least two open questions:

  • If prepare_item_for_response is supposed to add references to other entities, how does that work for collections?
  • How can one Response type know how to reference another Response type without knowing its Route? Do we need a global naming paradigm too, or would it be acceptable to reference a Controller class, which would make it easier to look up via the server?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions