Skip to content

Commit

Permalink
fix: resource IDs must be strings (#211)
Browse files Browse the repository at this point in the history
* errors is a top level member

* Resource ID must be a string
  • Loading branch information
kureuil authored and zacharygolba committed Jul 10, 2016
1 parent fd0a593 commit a8460e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/packages/serializer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ class Serializer {
}

let serialized: {
id: number,
id: string,
type: string,
links?: Object,
attributes: Object,
relationships?: Object
} = {
id,
id: id.toString(),
type,
attributes
};
Expand Down Expand Up @@ -519,7 +519,7 @@ class Serializer {

return {
data: {
id,
id: id.toString(),
type
},

Expand Down
2 changes: 1 addition & 1 deletion test/integration/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Integration: class Serializer', () => {
it('serializes id', () => {
const { data: { id } } = subject;

expect(id).to.equal(1);
expect(id).to.equal('1');
});

it('serializes attributes', () => {
Expand Down

0 comments on commit a8460e5

Please sign in to comment.