Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deserialize with different type? #243

Open
ninhva opened this issue Nov 29, 2020 · 0 comments
Open

How to deserialize with different type? #243

ninhva opened this issue Nov 29, 2020 · 0 comments

Comments

@ninhva
Copy link

ninhva commented Nov 29, 2020

{
  "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 ninhva changed the title How to serialize with different type? How to deserialize with different type? Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant