diff --git a/lib/model/api.js b/lib/model/api.js index 621750c222..a7e6330f58 100644 --- a/lib/model/api.js +++ b/lib/model/api.js @@ -34,7 +34,7 @@ function Api(api, options) { property(this, 'abbreviation', api.metadata.serviceAbbreviation); property(this, 'fullName', api.metadata.serviceFullName); property(this, 'serviceId', api.metadata.serviceId); - if (serviceIdentifier) { + if (serviceIdentifier && metadata[serviceIdentifier]) { property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false); } diff --git a/test/model/api.spec.js b/test/model/api.spec.js index b20f0003ff..61c5ad164f 100644 --- a/test/model/api.spec.js +++ b/test/model/api.spec.js @@ -46,6 +46,12 @@ }); }); + describe('serviceIdentifier', function() { + it('creates an API with passed serviceIdentifier', function() { + return expect(make({}, { serviceIdentifier: 'asdf' }).isApi).to.equal(true); + }); + }); + describe('className', function() { it('generates the correct class name from fullName', function() { var api;