diff --git a/modules/rtbhouseBidAdapter.js b/modules/rtbhouseBidAdapter.js index 245fc5f3ea2..36c08fc8626 100644 --- a/modules/rtbhouseBidAdapter.js +++ b/modules/rtbhouseBidAdapter.js @@ -115,10 +115,11 @@ function mapBanner(slot) { if (slot.mediaType === 'banner' || utils.deepAccess(slot, 'mediaTypes.banner') || (!slot.mediaType && !slot.mediaTypes)) { + var sizes = slot.sizes || slot.mediaTypes.banner.sizes; return { - w: slot.sizes[0][0], - h: slot.sizes[0][1], - format: slot.sizes.map(size => ({ + w: sizes[0][0], + h: sizes[0][1], + format: sizes.map(size => ({ w: size[0], h: size[1] })) diff --git a/modules/rtbhouseBidAdapter.md b/modules/rtbhouseBidAdapter.md index 233ed34053a..b8b59aa9edc 100644 --- a/modules/rtbhouseBidAdapter.md +++ b/modules/rtbhouseBidAdapter.md @@ -17,7 +17,11 @@ Please reach out to pmp@rtbhouse.com to receive your own // banner { code: 'test-div', - sizes: [[300, 250]], + mediaTypes: { + banner: { + sizes: [[300, 250]], + } + }, bids: [ { bidder: "rtbhouse", diff --git a/test/spec/modules/rtbhouseBidAdapter_spec.js b/test/spec/modules/rtbhouseBidAdapter_spec.js index 707a5f91bec..67845fa1983 100644 --- a/test/spec/modules/rtbhouseBidAdapter_spec.js +++ b/test/spec/modules/rtbhouseBidAdapter_spec.js @@ -19,7 +19,11 @@ describe('RTBHouseAdapter', () => { 'region': 'prebid-eu' }, 'adUnitCode': 'adunit-code', - 'sizes': [[300, 250], [300, 600]], + 'mediaTypes': { + 'banner': { + 'sizes': [[300, 250], [300, 600]], + } + }, 'bidId': '30b31c1838de1e', 'bidderRequestId': '22edbae2733bf6', 'auctionId': '1d1a030790a475' @@ -29,6 +33,13 @@ describe('RTBHouseAdapter', () => { expect(spec.isBidRequestValid(bid)).to.equal(true); }); + it('Checking backward compatibility. should return true', function () { + let bid2 = Object.assign({}, bid); + delete bid2.mediaTypes; + bid2.sizes = [[300, 250], [300, 600]]; + expect(spec.isBidRequestValid(bid2)).to.equal(true); + }); + it('should return false when required params are not passed', function () { let bid = Object.assign({}, bid); delete bid.params; @@ -49,7 +60,11 @@ describe('RTBHouseAdapter', () => { 'test': 1 }, 'adUnitCode': 'adunit-code', - 'sizes': [[300, 250], [300, 600]], + 'mediaTypes': { + 'banner': { + 'sizes': [[300, 250], [300, 600]], + } + }, 'bidId': '30b31c1838de1e', 'bidderRequestId': '22edbae2733bf6', 'auctionId': '1d1a030790a475',