Skip to content

Commit

Permalink
[api] Set id schema to any. #100
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Aug 18, 2012
1 parent 3d5cf8e commit e68bac0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/resourceful/core.js
Expand Up @@ -146,7 +146,8 @@ resourceful.define = function (name, definition) {
name: name, name: name,
properties: { properties: {
id: { id: {
type: 'string', type: 'any',
required: false
} }
}, },
links: [] links: []
Expand Down
4 changes: 2 additions & 2 deletions test/resourceful-test.js
Expand Up @@ -65,7 +65,7 @@ vows.describe('resourceful').addVows({
assert.isFunction(article.reload); assert.isFunction(article.reload);
}, },
"and doesn't have a value for `key`": function (article) { "and doesn't have a value for `key`": function (article) {
assert.isUndefined(article.key); assert.isNull(article.key);
} }
} }
} }
Expand Down Expand Up @@ -115,7 +115,7 @@ vows.describe('resourceful').addVows({
return new(R)({ title: 'The Great Gatsby', kind: 'Classic Novels' }); return new(R)({ title: 'The Great Gatsby', kind: 'Classic Novels' });
}, },
"should respond to toString()": function (r) { "should respond to toString()": function (r) {
assert.equal(r.toString(), '{"title":"The Great Gatsby","kind":"Classic Novels","resource":"Book"}'); assert.equal(r.toString(), '{"id":null,"title":"The Great Gatsby","kind":"Classic Novels","resource":"Book"}');
}, },
"should respond to toJSON()": function (r) { "should respond to toJSON()": function (r) {
assert.isObject(r.toJSON()); assert.isObject(r.toJSON());
Expand Down

0 comments on commit e68bac0

Please sign in to comment.