Permalink
Browse files

[api] Set id schema to `any`. #100

  • Loading branch information...
1 parent 3d5cf8e commit e68bac00f139aed47ecdef7ee878b40cb83322e6 @Marak Marak committed Aug 18, 2012
Showing with 4 additions and 3 deletions.
  1. +2 −1 lib/resourceful/core.js
  2. +2 −2 test/resourceful-test.js
View
@@ -146,7 +146,8 @@ resourceful.define = function (name, definition) {
name: name,
properties: {
id: {
- type: 'string',
+ type: 'any',
+ required: false
}
},
links: []
View
@@ -65,7 +65,7 @@ vows.describe('resourceful').addVows({
assert.isFunction(article.reload);
},
"and doesn't have a value for `key`": function (article) {
- assert.isUndefined(article.key);
+ assert.isNull(article.key);
}
}
}
@@ -115,7 +115,7 @@ vows.describe('resourceful').addVows({
return new(R)({ title: 'The Great Gatsby', kind: 'Classic Novels' });
},
"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) {
assert.isObject(r.toJSON());

0 comments on commit e68bac0

Please sign in to comment.