-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PulsePoint: Marking cp/ct params to be either String or Int (#3677)
- Loading branch information
1 parent
80a90dd
commit a907ecb
Showing
7 changed files
with
180 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
adapters/pulsepoint/pulsepointtest/exemplary/banner-string-bidder-params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "request-id", | ||
"site": { | ||
"page": "http://publisher.com/index.html", | ||
"publisher": { | ||
"id": "123456789", | ||
"name": "publisher.com" | ||
} | ||
}, | ||
"imp": [{ | ||
"id": "banner-1", | ||
"banner": { | ||
"w": 320, | ||
"h": 50 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"cp": "1234", | ||
"ct": "1001" | ||
} | ||
} | ||
}] | ||
}, | ||
"httpCalls": [{ | ||
"expectedRequest": { | ||
"headers": { | ||
"Content-Type": [ | ||
"application/json;charset=utf-8" | ||
], | ||
"Accept": [ | ||
"application/json" | ||
] | ||
}, | ||
"uri": "http://bidder.pulsepoint.com", | ||
"body": { | ||
"id": "request-id", | ||
"site": { | ||
"page": "http://publisher.com/index.html", | ||
"publisher": { | ||
"id": "1234", | ||
"name": "publisher.com" | ||
} | ||
}, | ||
"imp": [{ | ||
"id": "banner-1", | ||
"tagid": "1001", | ||
"banner": { | ||
"w": 320, | ||
"h": 50 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"cp": "1234", | ||
"ct": "1001" | ||
} | ||
} | ||
}] | ||
}, | ||
"impIDs":["banner-1"] | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "response-id", | ||
"seatbid": [{ | ||
"bid": [{ | ||
"id": "banner-1-bid", | ||
"impid": "banner-1", | ||
"price": 3.5, | ||
"adm": "<div>Creative</div>", | ||
"adomain": [ | ||
"advertiser.com" | ||
], | ||
"crid": "20", | ||
"w": 300, | ||
"h": 250 | ||
}], | ||
"seat": "pulsepoint-seat" | ||
}], | ||
"cur": "USD" | ||
} | ||
} | ||
}], | ||
"expectedBidResponses": [{ | ||
"bids": [{ | ||
"bid": { | ||
"id": "banner-1-bid", | ||
"impid": "banner-1", | ||
"price": 3.5, | ||
"adm": "<div>Creative</div>", | ||
"adomain": [ | ||
"advertiser.com" | ||
], | ||
"crid": "20", | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
"type": "banner" | ||
}] | ||
}] | ||
} |
31 changes: 31 additions & 0 deletions
31
adapters/pulsepoint/pulsepointtest/supplemental/bad-prebid-params-missing-param.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "request-id", | ||
"site": { | ||
"page": "http://publisher.com/index.html", | ||
"publisher": { | ||
"id": "123456789", | ||
"name": "publisher.com" | ||
} | ||
}, | ||
"imp": [{ | ||
"id": "banner-1", | ||
"banner": { | ||
"w": 320, | ||
"h": 50 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"cp": "1234" | ||
} | ||
} | ||
}] | ||
}, | ||
"httpCalls": [], | ||
"expectedMakeRequestsErrors": [{ | ||
"value": "param not found - tagID", | ||
"comparison": "literal" | ||
}], | ||
"expectedBidResponses": [], | ||
"expectedMakeBidsErrors": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package openrtb_ext | ||
|
||
import ( | ||
"github.com/prebid/prebid-server/v2/util/jsonutil" | ||
) | ||
|
||
// ExtImpPulsePoint defines the json spec for bidrequest.imp[i].ext.prebid.bidder.pulsepoint | ||
// PubId/TagId are mandatory params | ||
|
||
type ExtImpPulsePoint struct { | ||
PubID int `json:"cp"` | ||
TagID int `json:"ct"` | ||
PubID jsonutil.StringInt `json:"cp"` | ||
TagID jsonutil.StringInt `json:"ct"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters