jsonapi-serializer overwrites existing "links" attribute

Viewed 48

I use an API that returns a response with the following structure:

{
  "data": [
   {
     "id": "id-1",
     "type": "objectType",
     "attributes": { ... },
     "links":
       "linksDataAndMetadate": {...}
   }, ... 
  ],
  "links": 
    "thisLink": "some url",
    "thatLink": "another url"
}

We use jsonapi-serializer package in our code base for serialization/deseiralization, but when I use it to deserialize the response, the outer links part (the ones that includes "thisLink" and "thatLink") overwrites the "links" field inside the object attributes. Is there a way to use the package so that it will have a different behavior?

0 Answers
Related