diff --git a/templates/projects/api-server/data.js b/templates/projects/api-server/data.js index 9b117153..a747eb3a 100644 --- a/templates/projects/api-server/data.js +++ b/templates/projects/api-server/data.js @@ -43,6 +43,9 @@ template.server = { { name: 'RoleMapping', dataSource: 'db', + options: { + strictObjectIDCoercion: true, + }, public: false, }, { diff --git a/templates/projects/hello-world/data.js b/templates/projects/hello-world/data.js index d21894ea..740c9690 100644 --- a/templates/projects/hello-world/data.js +++ b/templates/projects/hello-world/data.js @@ -40,6 +40,9 @@ template.server = { { name: 'RoleMapping', dataSource: 'db', + options: { + strictObjectIDCoercion: true, + }, public: false, }, { diff --git a/templates/projects/notes/data.js b/templates/projects/notes/data.js index acb26c49..deb234cd 100644 --- a/templates/projects/notes/data.js +++ b/templates/projects/notes/data.js @@ -40,6 +40,9 @@ template.server = { { name: 'RoleMapping', dataSource: 'db', + options: { + strictObjectIDCoercion: true, + }, public: false, }, { diff --git a/test/end-to-end.js b/test/end-to-end.js index 4133afaa..7373a54c 100644 --- a/test/end-to-end.js +++ b/test/end-to-end.js @@ -394,6 +394,11 @@ describe('end-to-end', function() { .expect(422) .end(done); }); + + it('enables strictObjectIDCoercion for RoleMapping model', function() { + expect(app.models.RoleMapping.settings.strictObjectIDCoercion) + .to.equal(true); + }); }); describe('notes template', function() { @@ -464,6 +469,11 @@ describe('end-to-end', function() { } }); }); + + it('enables strictObjectIDCoercion for RoleMapping model', function() { + expect(app.models.RoleMapping.settings.strictObjectIDCoercion) + .to.equal(true); + }); }); describe('hello-world template', function() { @@ -504,6 +514,11 @@ describe('end-to-end', function() { .get('/api/Messages') .expect(404, done); }); + + it('enables strictObjectIDCoercion for RoleMapping model', function() { + expect(app.models.RoleMapping.settings.strictObjectIDCoercion) + .to.equal(true); + }); }); describe('scaffold 3.x loopback project with option 3.x', function(done) {