-
Notifications
You must be signed in to change notification settings - Fork 0
[Exch-13810] return buyer exts in response to dsp #18
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"` |
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.
changed, thanks for suggestion
adapters/openx/openx_test.go
Outdated
| func TestGetBidMeta(t *testing.T) { | ||
| buyerId := "123" | ||
| dspId := "456" | ||
| bradId := "789" |
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.
| bradId := "789" | |
| brandId := "789" |
sergseven
left a comment
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.