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.

Comments

e0ipso created an issue. See original summary.

e0ipso’s picture

Status: Active » Needs review
StatusFileSize
new7.4 KB

With the provided patch you can do things like article/1/uid and get a user. You can also do article/1/field_tags and get a collection of tags.

e0ipso’s picture

I'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.

  • e0ipso committed df551a9 on 8.x-1.x
    Issue #2730879 by e0ipso: [FEATURE] Support /articles/{node}/{related}...
e0ipso’s picture

StatusFileSize
new7.55 KB

I made some minor modifications to the patch before merging it. This is the patch.

e0ipso’s picture

Status: Needs review » Fixed

Status: Fixed » Needs work

The last submitted patch, 5: 2730879--related-routes--5.patch, failed testing.

The last submitted patch, 5: 2730879--related-routes--5.patch, failed testing.

e0ipso’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.