jsonapi-serializer icon indicating copy to clipboard operation
jsonapi-serializer copied to clipboard

How to deserialize with different type?

Open ninhva opened this issue 5 years ago • 0 comments

{
  "data": {
    "id": "1",
    "type": "todos",
    "attributes": {
      "title": "Clean the kitchen!"
    },
    "relationships": {
      "user": {
        "data": {
          "type": "users",
          "id": "2"
        }
      },
    },
  },
  "included": [
    {
      "id": 2,
      "type": "users",
      "attributes": {
        "name": "Steve"
      }
    }
  ],
}

I have a response, in relationships, type of user.id is string but in included it is as number.

How to deserialize it?

ninhva avatar Nov 29 '20 16:11 ninhva