[Exch-13810] return buyer exts in response to dsp#18
Conversation
adapters/openx/openx.go
Outdated
| DspId *string `json:"dsp_id,omitempty"` | ||
| BrandId *string `json:"brand_id,omitempty"` | ||
| BuyerId *string `json:"buyer_id,omitempty"` |
There was a problem hiding this comment.
minor
not critical, but I don't think we need pointers here, more common to define just strings and check for empty string
| DspId *string `json:"dsp_id,omitempty"` | |
| BrandId *string `json:"brand_id,omitempty"` | |
| BuyerId *string `json:"buyer_id,omitempty"` | |
| DspId string `json:"dsp_id,omitempty"` | |
| BrandId string `json:"brand_id,omitempty"` | |
| BuyerId string `json:"buyer_id,omitempty"` |
adapters/openx/openx_test.go
Outdated
| func TestGetBidMeta(t *testing.T) { | ||
| buyerId := "123" | ||
| dspId := "456" | ||
| bradId := "789" |
There was a problem hiding this comment.
| bradId := "789" | |
| brandId := "789" |
sergseven
left a comment
There was a problem hiding this comment.
LGTM
I am also wondering what other types of test are available to additionally verify the feature?
| } | ||
| } | ||
|
|
||
| func getBuyerIdFromExt(ext *oxBidExt) int { |
There was a problem hiding this comment.
this function will work correctly
but still it's best practice to check for an empty value before passing value to strconv.Atoi() to avoid spawning an error each time there is no value available in json
| func getBuyerIdFromExt(ext *oxBidExt) int { | |
| func getBuyerIdFromExt(ext *oxBidExt) int { | |
| if ext.BuyerId == "" { | |
| return 0 | |
| } |
There was a problem hiding this comment.
added, thanks for the suggestion
At the moment, this is the only way I know to test this functionality before deployment. Unfortunately, in the tests that use JSON files, the bid is compared with the expectedBidResponse from TypedBid.Bid, which in our case will never be equal because we add values to meta. Also other adapters test similar features this way. |
|
merged in prebid#4507 (comment) |
No description provided.