-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validating bid response params #1738
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add all required keys
src/adapters/bidderFactory.js
Outdated
@@ -107,6 +107,8 @@ import { logWarn, logError, parseQueryStringParameters, delayExecution } from 's | |||
* @property {string} url The URL which makes the sync happen. | |||
*/ | |||
|
|||
const BID_RESPONSE_KEYS = ['currency', 'netRevenue', 'ttl']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have more required params. You should check http://prebid.org/dev-docs/bidder-adapter-1.html#interpreting-the-response ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
modules/appnexusAstBidAdapter.js
Outdated
@@ -183,14 +183,18 @@ function newBid(serverBid, rtbBid) { | |||
cpm: rtbBid.cpm, | |||
creative_id: rtbBid.creative_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appnexusAst
will need bidderCode
andcreativeId
added to pass validation now
const prebidBid = Object.assign(bidfactory.createBid(STATUS.GOOD, bidRequest), bid); | ||
addBidWithCode(bidRequest.placementCode, prebidBid); | ||
// In Prebid 1.0 all the validation logic from bidmanager will move here, as of now we are only validating new params so that adapters dont miss adding them. | ||
if (hasValidKeys(bid)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful here... we've been telling adapters not to add bidderCode
, because it breaks aliasing. The bidderFactory
should be doing that for them.
But... that happens a few lines after this: Object.assign(bidfactory.createBid(STATUS.GOOD, bidRequest), bid);
.
So I don't think should be make sure that bidderCode
exists here. If anything, we should make sure that it doesn't exist yet.
src/adapters/bidderFactory.js
Outdated
@@ -107,6 +107,8 @@ import { logWarn, logError, parseQueryStringParameters, delayExecution } from 's | |||
* @property {string} url The URL which makes the sync happen. | |||
*/ | |||
|
|||
const BID_RESPONSE_KEYS = ['requestId', 'bidderCode', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId', 'netRevenue', 'currency']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per recent discussion, it looks like bidderCode
should not be a required param.
…dresponse # Conflicts: # test/spec/modules/appnexusAstBidAdapter_spec.js
I think ideally we'd want to validate on media type (probably create different bid objects for the different types) but that doesn't have to be done in this PR. |
* 'master' of https://github.com/prebid/Prebid.js: (22 commits) Update GetIntent adapter to 1.0 version (prebid#1721) Add `usePaymentRule` param to AN bidders (prebid#1778) New hooks API (replaces monkey-patching for currency) (prebid#1683) Change prebidServer to call client user syncs if they exist (prebid#1734) Fix Centro adapter to allow requests of the same units (prebid#1746) add vastUrl + media type for video bids Prebid Server (prebid#1739) Update adxcg adapter for prebid 1.0 (prebid#1741) Update yieldmoBid adapter request url (prebid#1771) Upgrade Quantcast adapter for Prebid 1.0 (prebid#1753) Fidelity Media Adapter update. Prebid v1.0 (prebid#1719) Kargo Adapter for Prebid 1.0 (prebid#1729) updated for prebid 1.0 api (prebid#1722) Add AdOcean adapter (prebid#1735) Update Conversant adapter to Prebid 1.0 (prebid#1711) Fix test-coverage bug (prebid#1765) Migrating TrustX adapter to 1.0 (prebid#1709) Update Improve Digital adapter for Prebid 1.0 (prebid#1728) Fixed the argument type on getUserSyncs. (prebid#1767) nanointeractive bid adapter (prebid#1627) Validating bid response params (prebid#1738) ...
* validating bid response params * added all required params * replaced id with correct param requestid * keeping only common keys to validate
* validating bid response params * added all required params * replaced id with correct param requestid * keeping only common keys to validate
Type of change
Description of change
Validating bid response params
currency
, 'netRevenueand
ttl` for 1.0 adapters.