-
Notifications
You must be signed in to change notification settings - Fork 764
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
OpenX: accept incoming string fields to support Prebid.js 9 #3668
Changes from all commits
47306c4
67c1018
370ff75
028d8db
21d557e
2a84206
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"banner": {}, | ||
"ext": { | ||
"bidder": { | ||
"unit": "banner-unit-1", | ||
"unit": "111", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious, why "111" instead of "1"? Is there a test involved with the length of the unit string? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No functional reason, just think it's easier to find and replace if needed. |
||
"delDomain": "se-demo-d.openx.net" | ||
} | ||
} | ||
|
@@ -17,7 +17,7 @@ | |
"video": {"mimes": ["video/mp4"]}, | ||
"ext": { | ||
"bidder": { | ||
"unit": "video-unit-1", | ||
"unit": "333", | ||
"delDomain": "se-demo-d.openx.net" | ||
} | ||
} | ||
|
@@ -27,7 +27,7 @@ | |
"banner": {}, | ||
"ext": { | ||
"bidder": { | ||
"unit": "banner-unit-2", | ||
"unit": "222", | ||
"delDomain": "se-demo-d.openx.net" | ||
} | ||
} | ||
|
@@ -37,7 +37,7 @@ | |
"video": {"mimes": ["video/mp4"]}, | ||
"ext": { | ||
"bidder": { | ||
"unit": "video-unit-2", | ||
"unit": "444", | ||
"delDomain": "se-demo-d.openx.net" | ||
} | ||
} | ||
|
@@ -48,7 +48,7 @@ | |
"video": {"mimes": ["video/mp4"]}, | ||
"ext": { | ||
"bidder": { | ||
"unit": "multi-type-unit", | ||
"unit": "555", | ||
"delDomain": "se-demo-d.openx.net" | ||
} | ||
} | ||
|
@@ -66,18 +66,18 @@ | |
{ | ||
"id": "banner-imp-1", | ||
"banner": {}, | ||
"tagid": "banner-unit-1" | ||
"tagid": "111" | ||
}, | ||
{ | ||
"id": "banner-imp-2", | ||
"banner": {}, | ||
"tagid": "banner-unit-2" | ||
"tagid": "222" | ||
}, | ||
{ | ||
"id": "multi-type-imp", | ||
"banner": {}, | ||
"video": {"mimes": ["video/mp4"]}, | ||
"tagid": "multi-type-unit" | ||
"tagid": "555" | ||
} | ||
], | ||
"ext": { | ||
|
@@ -125,7 +125,7 @@ | |
{ | ||
"id": "video-imp-1", | ||
"video": {"mimes": ["video/mp4"]}, | ||
"tagid": "video-unit-1" | ||
"tagid": "333" | ||
} | ||
], | ||
"ext": { | ||
|
@@ -163,7 +163,7 @@ | |
{ | ||
"id": "video-imp-2", | ||
"video": {"mimes": ["video/mp4"]}, | ||
"tagid": "video-unit-2" | ||
"tagid": "444" | ||
} | ||
], | ||
"ext": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,14 +40,17 @@ func TestInvalidParams(t *testing.T) { | |
} | ||
|
||
var validParams = []string{ | ||
`{"unit": 123, "delDomain": "foo.ba"}`, | ||
`{"unit": "123", "delDomain": "foo.ba"}`, | ||
`{"unit": "123", "delDomain": "foo.bar"}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": 0.1}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": "0.1"}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customParams": {"foo": "bar"}}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customParams": {"foo": ["bar", "baz"]}}`, | ||
} | ||
|
||
var invalidParams = []string{ | ||
`{"unit": "", "delDomain": "foo.bar"}`, | ||
`{"unit": "123"}`, | ||
`{"delDomain": "foo.bar"}`, | ||
`{"unit": "", "delDomain": "foo.bar"}`, | ||
|
@@ -56,7 +59,10 @@ var invalidParams = []string{ | |
`{"unit": "123", "delDomain": "foo.b"}`, | ||
`{"unit": "123", "delDomain": "foo.barr"}`, | ||
`{"unit": "123", "delDomain": ".bar"}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": "0.1"}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": ""}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": "1."}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": "1.0x"}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": "-0.1"}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customFloor": -0.1}`, | ||
`{"unit": "123", "delDomain": "foo.bar", "customParams": "foo: bar"}`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recommend adding customFloor tests invalid test cases as "1." and "1.0x" to add more test coverage of the regex. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
"openx": { | ||
"unit": "539439964", | ||
"delDomain": "se-demo-d.openx.net", | ||
"customFloor": 0.1, | ||
"customFloor": "0.5", | ||
"customParams": {"foo": "bar"} | ||
} | ||
} | ||
Comment on lines
43
to
49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @laurb9 why was this file changed? Adapter change should be limited to Adapter package There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file contains an OpenX adapter request, and we thought it would be best if it were updated to the most recent request format. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could move this to openx specific exemplary test folder There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can undo this particular line change if it blocks the review, but moving it to the openx test folder does not add any new use cases there. Removing samples from |
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,10 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
package openrtb_ext | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
import "encoding/json" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
// ExtImpOpenx defines the contract for bidrequest.imp[i].ext.prebid.bidder.openx | ||||||||||||||||||||||||||||||||||||||||||||||||
type ExtImpOpenx struct { | ||||||||||||||||||||||||||||||||||||||||||||||||
Unit string `json:"unit"` | ||||||||||||||||||||||||||||||||||||||||||||||||
Unit json.Number `json:"unit"` | ||||||||||||||||||||||||||||||||||||||||||||||||
Platform string `json:"platform"` | ||||||||||||||||||||||||||||||||||||||||||||||||
DelDomain string `json:"delDomain"` | ||||||||||||||||||||||||||||||||||||||||||||||||
CustomFloor float64 `json:"customFloor"` | ||||||||||||||||||||||||||||||||||||||||||||||||
CustomFloor json.Number `json:"customFloor"` | ||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+7
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @laurb9 prebid-server/util/jsonutil/stringInt.go Lines 7 to 29 in a1f48b5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||||||||||||||||||
CustomParams map[string]interface{} `json:"customParams"` | ||||||||||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ endpoint: "http://rtb.openx.net/prebid" | |
maintainer: | ||
email: "[email protected]" | ||
gvlVendorID: 69 | ||
endpointCompression: gzip | ||
capabilities: | ||
app: | ||
mediaTypes: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,9 @@ | |
"type": "object", | ||
"properties": { | ||
"unit": { | ||
"type": "string", | ||
"type": ["number", "string"], | ||
"description": "The ad unit id.", | ||
"minimum": 0, | ||
"pattern": "^[0-9]+$" | ||
}, | ||
"delDomain": { | ||
|
@@ -22,9 +23,10 @@ | |
"format": "uuid" | ||
}, | ||
"customFloor": { | ||
"type": "number", | ||
"type": ["number", "string"], | ||
"description": "The minimum CPM price in USD.", | ||
"minimum": 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should add/update json tests
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These parameter variations are in |
||
"minimum": 0, | ||
"pattern": "^[0-9]+(\\.[0-9]+)?$" | ||
}, | ||
"customParams": { | ||
"type": "object", | ||
|
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.
Was this test case previously invalid? Doesn't look like it adhered to the unit json schema pattern.
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.
I don't recall if these were valid at some point in the past, but they are not now.