-
Notifications
You must be signed in to change notification settings - Fork 16
Closed as not planned
Labels
Description
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)