From 8e01f8930860692be2aac1dff8921cc2371dc028 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Wed, 31 Jan 2024 14:59:20 -0500 Subject: [PATCH] Appnexus Bid Adapter: Update DSA field names --- modules/appnexusBidAdapter.js | 12 +++--------- test/spec/modules/appnexusBidAdapter_spec.js | 10 +++++----- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index c7d6fbd95a5..a6dc05a101f 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -354,22 +354,16 @@ export const spec = { if (bidderRequest?.ortb2?.regs?.ext?.dsa) { const pubDsaObj = bidderRequest.ortb2.regs.ext.dsa; const dsaObj = {}; - ['required', 'pubrender', 'datatopub'].forEach((dsaKey) => { + ['dsarequired', 'pubrender', 'datatopub'].forEach((dsaKey) => { if (isNumber(pubDsaObj[dsaKey])) { - if (dsaKey === 'required') { - // our client-side endpoint has a different name for the 'required' field - // ...this is the only exception to the openrtb spec for these fields - dsaObj.dsainfo = pubDsaObj[dsaKey]; - } else { - dsaObj[dsaKey] = pubDsaObj[dsaKey]; - } + dsaObj[dsaKey] = pubDsaObj[dsaKey]; } }); if (isArray(pubDsaObj.transparency) && pubDsaObj.transparency.every((v) => isPlainObject(v))) { const tpData = []; pubDsaObj.transparency.forEach((tpObj) => { - if (isStr(tpObj.domain) && tpObj.domain != '' && isArray(tpObj.params) && tpObj.params.every((v) => isNumber(v))) { + if (isStr(tpObj.domain) && tpObj.domain != '' && isArray(tpObj.dsaparams) && tpObj.dsaparams.every((v) => isNumber(v))) { tpData.push(tpObj); } }); diff --git a/test/spec/modules/appnexusBidAdapter_spec.js b/test/spec/modules/appnexusBidAdapter_spec.js index c44ef475290..cf6a1704bde 100644 --- a/test/spec/modules/appnexusBidAdapter_spec.js +++ b/test/spec/modules/appnexusBidAdapter_spec.js @@ -1214,15 +1214,15 @@ describe('AppNexusAdapter', function () { 'regs': { 'ext': { 'dsa': { - 'required': 1, + 'dsarequired': 1, 'pubrender': 0, 'datatopub': 1, 'transparency': [{ 'domain': 'good-domain', - 'params': [1, 2] + 'dsaparams': [1, 2] }, { 'domain': 'bad-setup', - 'params': ['1', 3] + 'dsaparams': ['1', 3] }] } } @@ -1235,12 +1235,12 @@ describe('AppNexusAdapter', function () { const payload = JSON.parse(request.data); expect(payload.dsa).to.exist; - expect(payload.dsa.dsainfo).to.equal(1); + expect(payload.dsa.dsarequired).to.equal(1); expect(payload.dsa.pubrender).to.equal(0); expect(payload.dsa.datatopub).to.equal(1); expect(payload.dsa.transparency).to.deep.equal([{ 'domain': 'good-domain', - 'params': [1, 2] + 'dsaparams': [1, 2] }]); });