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

Support type in deserialized data #138

Open
Ayc0 opened this issue Aug 2, 2024 · 2 comments · May be fixed by #139 or #147
Open

Support type in deserialized data #138

Ayc0 opened this issue Aug 2, 2024 · 2 comments · May be fixed by #139 or #147

Comments

@Ayc0
Copy link

Ayc0 commented Aug 2, 2024

When running this code:

const serializedData = {
    data: {
        type: 'articles',
        id: '1',
        attributes: {
            type: 'articles',
            type: '123',
            title: 'JSON:API paints my bikeshed!',
        },

    },
};

deserialize(serializedData);

we get

{
  "id": "1",
  "type": "123",
  "title": "JSON:API paints my bikeshed!"
}

The type articles gets lost in the deserialization process. And I don't think we can just pass it top level as this could conflict with a attributes.type field.

What do you think about adding something like Symbol('type')? (would avoid conflicts and give access to the types)

@Ayc0 Ayc0 linked a pull request Aug 2, 2024 that will close this issue
@Ayc0 Ayc0 linked a pull request Aug 26, 2024 that will close this issue
Copy link

github-actions bot commented Oct 2, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Oct 2, 2024
@Ayc0
Copy link
Author

Ayc0 commented Oct 2, 2024

Not stale

@github-actions github-actions bot removed the Stale label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant