jeudi 28 juin 2018

Is it safe to remove `links.related` from JSON API response? (Ember.js)

Good day,

Does removing of links.related on my JSON response will affect any Ember-Data relationship fetching?

relationships": {
  "comments": {
    "links": {
      "related": "http://localhost:3099/api/v1/articles/1/comments"
    },
    "data": [
      {
        "type": "comments",
        "id": 1
      },
      {
        "type": "comments",
        "id": 2
      },
      { ... More comments here ... }
    ]
  }
}

I've read this article : https://thejsguy.com/2016/02/21/handling-nested-resources-in-ember-data.html and this points me to Ember data uses those links internally to fetch the related data so I won't have to access those URLs and make requests to them. I need more concrete opinion before we make any changes to our API.




Aucun commentaire:

Enregistrer un commentaire