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

Conversation

@danielbachhuber
Copy link
Member

Fixes #1818

@danielbachhuber danielbachhuber added this to the 2.0 Beta 9 milestone Dec 10, 2015
@danielbachhuber
Copy link
Member Author

@WP-API/amigos #reviewmerge

@rachelbaker
Copy link
Member

@danielbachhuber would it also be worthwhile to add rest_base in the post_type response data?

rachelbaker added a commit that referenced this pull request Dec 10, 2015
Link Types to their Collections and vice versa
@rachelbaker rachelbaker merged commit 12f0974 into develop Dec 10, 2015
@rachelbaker rachelbaker deleted the 1818-type-links branch December 10, 2015 15:46
@joehoyle
Copy link
Member

I'm a pretty big -1 on adding rest_base anywhere - it doesn't have much meaning in the context of just the API, and encourages manual building of arbitrary URLs which I think we'd be best to stick to just stick to _links.

@joehoyle
Copy link
Member

It's not clear to me that collection is the correct relation, from http://tools.ietf.org/html/rfc6573

When included in a resource that represents a member of a collection,
the 'collection' link relation identifies a target resource that
represents a collection of which the context resource is a member.

For example, if a resource represents a single product in a catalog,
that same representation may include a link to a resource that
represents a product group to which this single product belongs

If anything collection would be a relation on a single post, pointing back to the collection - or the link of a single post could also point to the post type object via the collection relation also (akin to a product pointing to a "product group" object.

The collection relation on a post type object (as this PR makes it) should be pointing to a collection / collection object of post type objects. it's saying "this resource is a member of the collection x", not "the items in this collection are here".

If anything we'd want the item relation

When included in a resource that represents a collection, the 'item'
link relation identifies a target resource that represents a member
of that collection.

For example, if a resource represents a catalog of products, that
same representation may include one or more links to resources that
represent members of that catalog.

However, what we really wan't is items but these no spec for that currently.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants