diff --git a/adapters/rubicon/rubicon.go b/adapters/rubicon/rubicon.go index baf4b3e191b..e5eb0fdc80c 100644 --- a/adapters/rubicon/rubicon.go +++ b/adapters/rubicon/rubicon.go @@ -18,7 +18,6 @@ import ( "github.com/prebid/prebid-server/v3/util/maputil" "github.com/buger/jsonparser" - "github.com/prebid/openrtb/v20/adcom1" "github.com/prebid/openrtb/v20/openrtb2" ) @@ -174,34 +173,6 @@ type extPrebid struct { Bidder json.RawMessage `json:"bidder,omitempty"` } -// defines the contract for bidrequest.user.ext.eids[i].ext -type rubiconUserExtEidExt struct { - Segments []string `json:"segments,omitempty"` -} - -type mappedRubiconUidsParam struct { - segments []string - liverampIdl string -} - -func resolveVideoSizeId(placement adcom1.VideoPlacementSubtype, instl int8, impId string) (sizeID int, err error) { - if placement != 0 { - if placement == 1 { - return 201, nil - } - if placement == 3 { - return 203, nil - } - } - - if instl == 1 { - return 202, nil - } - return 0, &errortypes.BadInput{ - Message: fmt.Sprintf("video.size_id can not be resolved in impression with id : %s", impId), - } -} - func appendTrackerToUrl(uri string, tracker string) (res string) { // Append integration method. Adapter init happens once urlObject, err := url.Parse(uri) @@ -374,23 +345,18 @@ func (a *RubiconAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *ada if isVideo { videoCopy := *imp.Video - videoSizeId := rubiconExt.Video.VideoSizeID - if videoSizeId == 0 { - resolvedSizeId, err := resolveVideoSizeId(imp.Video.Placement, imp.Instl, imp.ID) - if err != nil { - errs = append(errs, err) - continue - } - videoSizeId = resolvedSizeId - } - // if imp.rwdd = 1, set imp.video.ext.videotype = "rewarded" var videoType = "" if imp.Rwdd == 1 { videoType = "rewarded" imp.Rwdd = 0 } - videoExt := rubiconVideoExt{Skip: rubiconExt.Video.Skip, SkipDelay: rubiconExt.Video.SkipDelay, VideoType: videoType, RP: rubiconVideoExtRP{SizeID: videoSizeId}} + videoExt := rubiconVideoExt{ + Skip: rubiconExt.Video.Skip, + SkipDelay: rubiconExt.Video.SkipDelay, + VideoType: videoType, + RP: rubiconVideoExtRP{SizeID: rubiconExt.Video.VideoSizeID}, + } videoCopy.Ext, err = json.Marshal(&videoExt) imp.Video = &videoCopy imp.Banner = nil diff --git a/adapters/rubicon/rubicon_test.go b/adapters/rubicon/rubicon_test.go index 168c1d15343..169541a6e2f 100644 --- a/adapters/rubicon/rubicon_test.go +++ b/adapters/rubicon/rubicon_test.go @@ -143,52 +143,6 @@ func TestResolveNativeObject(t *testing.T) { } } -func TestResolveVideoSizeId(t *testing.T) { - testScenarios := []struct { - placement adcom1.VideoPlacementSubtype - instl int8 - impId string - expected int - expectedErr error - }{ - { - placement: 1, - instl: 1, - impId: "impId", - expected: 201, - expectedErr: nil, - }, - { - placement: 3, - instl: 1, - impId: "impId", - expected: 203, - expectedErr: nil, - }, - { - placement: 4, - instl: 1, - impId: "impId", - expected: 202, - expectedErr: nil, - }, - { - placement: 4, - instl: 3, - impId: "impId", - expectedErr: &errortypes.BadInput{ - Message: "video.size_id can not be resolved in impression with id : impId", - }, - }, - } - - for _, scenario := range testScenarios { - res, err := resolveVideoSizeId(scenario.placement, scenario.instl, scenario.impId) - assert.Equal(t, scenario.expected, res) - assert.Equal(t, scenario.expectedErr, err) - } -} - func TestOpenRTBRequestWithDifferentBidFloorAttributes(t *testing.T) { testScenarios := []struct { bidFloor float64 diff --git a/adapters/rubicon/rubicontest/exemplary/app-imp-fpd.json b/adapters/rubicon/rubicontest/exemplary/app-imp-fpd.json index 4e7c2a92148..4906754af43 100644 --- a/adapters/rubicon/rubicontest/exemplary/app-imp-fpd.json +++ b/adapters/rubicon/rubicontest/exemplary/app-imp-fpd.json @@ -300,7 +300,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json b/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json index c47cd3f9c36..e39375ceb85 100644 --- a/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json +++ b/adapters/rubicon/rubicontest/exemplary/bidonmultiformat.json @@ -192,7 +192,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/exemplary/flexible-schema.json b/adapters/rubicon/rubicontest/exemplary/flexible-schema.json index f4dcebc2280..18af7fcfca6 100644 --- a/adapters/rubicon/rubicontest/exemplary/flexible-schema.json +++ b/adapters/rubicon/rubicontest/exemplary/flexible-schema.json @@ -300,7 +300,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/exemplary/hardcode-secure.json b/adapters/rubicon/rubicontest/exemplary/hardcode-secure.json index 9df133385c6..4089136b995 100644 --- a/adapters/rubicon/rubicontest/exemplary/hardcode-secure.json +++ b/adapters/rubicon/rubicontest/exemplary/hardcode-secure.json @@ -303,7 +303,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/exemplary/simple-video.json b/adapters/rubicon/rubicontest/exemplary/simple-video.json index 3bceef2cf38..56df274d845 100644 --- a/adapters/rubicon/rubicontest/exemplary/simple-video.json +++ b/adapters/rubicon/rubicontest/exemplary/simple-video.json @@ -137,6 +137,7 @@ }, "bidder": { "video": { + "size_id": 10 }, "accountId": 1001, "siteId": 113932, @@ -302,7 +303,7 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 + "size_id": 10 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/exemplary/site-imp-fpd.json b/adapters/rubicon/rubicontest/exemplary/site-imp-fpd.json index b8519dabdb3..114d9fde283 100644 --- a/adapters/rubicon/rubicontest/exemplary/site-imp-fpd.json +++ b/adapters/rubicon/rubicontest/exemplary/site-imp-fpd.json @@ -415,7 +415,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/exemplary/user-fpd.json b/adapters/rubicon/rubicontest/exemplary/user-fpd.json index c989c6a1e19..f62e5572075 100644 --- a/adapters/rubicon/rubicontest/exemplary/user-fpd.json +++ b/adapters/rubicon/rubicontest/exemplary/user-fpd.json @@ -244,7 +244,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/supplemental/no-site-content-data.json b/adapters/rubicon/rubicontest/supplemental/no-site-content-data.json index b121d75a0f6..babce0a4aa6 100644 --- a/adapters/rubicon/rubicontest/supplemental/no-site-content-data.json +++ b/adapters/rubicon/rubicontest/supplemental/no-site-content-data.json @@ -215,7 +215,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/supplemental/no-site-content.json b/adapters/rubicon/rubicontest/supplemental/no-site-content.json index 65c3cacd858..20f8a7144fe 100644 --- a/adapters/rubicon/rubicontest/supplemental/no-site-content.json +++ b/adapters/rubicon/rubicontest/supplemental/no-site-content.json @@ -211,7 +211,6 @@ "placement": 3, "ext": { "rp": { - "size_id": 203 } }, "mimes": [ diff --git a/adapters/rubicon/rubicontest/supplemental/required-video-size-id.json b/adapters/rubicon/rubicontest/supplemental/required-video-size-id.json deleted file mode 100644 index 8e7482adfc0..00000000000 --- a/adapters/rubicon/rubicontest/supplemental/required-video-size-id.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-req-id", - "imp": [ - { - "id": "test-imp-1", - "video": { - "w": 640, - "h": 480, - "linearity": 1 - }, - "ext": { - "bidder": { - "accountId": 1001, - "siteId":113932, - "zoneId":535510 - } - } - } - ], - "site": { - "page": "prebid.org" - } - }, - "expectedMakeRequestsErrors": [ - { - "value": "video.size_id can not be resolved in impression with id : test-imp-1", - "comparison": "literal" - } - ] -}