Skip to content

Commit a8460e5

Browse files
kureuilzacharygolba
authored andcommitted
fix: resource IDs must be strings (#211)
* errors is a top level member * Resource ID must be a string
1 parent fd0a593 commit a8460e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/packages/serializer/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,13 @@ class Serializer {
407407
}
408408

409409
let serialized: {
410-
id: number,
410+
id: string,
411411
type: string,
412412
links?: Object,
413413
attributes: Object,
414414
relationships?: Object
415415
} = {
416-
id,
416+
id: id.toString(),
417417
type,
418418
attributes
419419
};
@@ -519,7 +519,7 @@ class Serializer {
519519

520520
return {
521521
data: {
522-
id,
522+
id: id.toString(),
523523
type
524524
},
525525

test/integration/serializer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Integration: class Serializer', () => {
1919
it('serializes id', () => {
2020
const { data: { id } } = subject;
2121

22-
expect(id).to.equal(1);
22+
expect(id).to.equal('1');
2323
});
2424

2525
it('serializes attributes', () => {

0 commit comments

Comments
 (0)