Problem/Motivation
The JSON API specification we need to support fetching the relationship contents via the related route.
Proposed resolution
Do an intelligent swap of the return object based on the fetched relationship. If the relationship is a to-one relationship we should return as an individual, whereas if the relationship is a to-many we should return as a collection.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2730879--related-routes--5.patch | 7.55 KB | e0ipso |
Comments
Comment #2
e0ipsoWith the provided patch you can do things like
article/1/uidand get a user. You can also doarticle/1/field_tagsand get a collection of tags.Comment #3
e0ipsoI'm merging this since it's causing a lot of merge conflicts with #2731155: [FEATURE] Support /articles/{node}/relationships/{related} routes. Please, feel free to review and add as many follow ups as you need.
Comment #5
e0ipsoI made some minor modifications to the patch before merging it. This is the patch.
Comment #6
e0ipsoComment #9
e0ipso