JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Custom relationships

Open
#800 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
Ruby
Stars
2.3k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

Is it possible to create custom relationships object like with links? https://github.com/cerebris/jsonapi-resources#custom-links

My problem is that I have a Activity model with array column in it. I would like to create relationships link like that:

{
  "relationships": {
    "links": {
      "related": "/places?ids=1321364,356955
    }
  }
}

where ids are taken from that column. Would it be some kind of self-relationship?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the custom-links section linked in the issue and inspect how Activity resources and relationships are represented. Determine whether an array-backed custom related link is an existing relationship pattern or requires a new design; completion would need a clearly documented or implemented approach, with the expected JSON shape confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.