diff --git a/adapters/rubicon/rubicon.go b/adapters/rubicon/rubicon.go index ee737bd05ea..a69530de831 100644 --- a/adapters/rubicon/rubicon.go +++ b/adapters/rubicon/rubicon.go @@ -49,15 +49,23 @@ type rubiconParams struct { } type bidRequestExt struct { - Rubicon bidRequestExtRubicon `json:"rubicon,omitempty"` + Prebid bidRequestExtPrebid `json:"prebid"` } -type bidRequestExtRubicon struct { - Debug bidRequestExtRubiconDebug `json:"debug,omitempty"` +type bidRequestExtPrebid struct { + Bidders bidRequestExtPrebidBidders `json:"bidders"` } -type bidRequestExtRubiconDebug struct { - CpmOverride float64 `json:"cpmOverride,omitempty"` +type bidRequestExtPrebidBidders struct { + Rubicon prebidBiddersRubicon `json:"rubicon,omitempty"` +} + +type prebidBiddersRubicon struct { + Debug prebidBiddersRubiconDebug `json:"debug,omitempty"` +} + +type prebidBiddersRubiconDebug struct { + CpmOverride float64 `json:"cpmoverride,omitempty"` } type rubiconImpExtRPTrack struct { @@ -952,7 +960,7 @@ func cmpOverrideFromBidRequest(bidRequest *openrtb.BidRequest) float64 { return 0 } - return bidRequestExt.Rubicon.Debug.CpmOverride + return bidRequestExt.Prebid.Bidders.Rubicon.Debug.CpmOverride } func mapImpIdToCpmOverride(imps []openrtb.Imp) map[string]float64 { diff --git a/adapters/rubicon/rubicon_test.go b/adapters/rubicon/rubicon_test.go index 7a2cc28896b..0489797561b 100644 --- a/adapters/rubicon/rubicon_test.go +++ b/adapters/rubicon/rubicon_test.go @@ -1442,10 +1442,12 @@ func TestOpenRTBResponseOverridePriceFromBidRequest(t *testing.T) { "zoneId": 327642 }}`), }}, - Ext: json.RawMessage(`{"rubicon": { - "debug": { - "cpmOverride" : 10 - }}}`), + Ext: json.RawMessage(`{"prebid": { + "bidders": { + "rubicon": { + "debug": { + "cpmoverride": 10 + }}}}}`), } requestJson, _ := json.Marshal(request) @@ -1486,14 +1488,16 @@ func TestOpenRTBResponseOverridePriceFromCorrespondingImp(t *testing.T) { "siteId": 68780, "zoneId": 327642, "debug": { - "cpmOverride" : 20 + "cpmoverride" : 20 } }}`), }}, - Ext: json.RawMessage(`{"rubicon": { - "debug": { - "cpmOverride" : 10 - }}}`), + Ext: json.RawMessage(`{"prebid": { + "bidders": { + "rubicon": { + "debug": { + "cpmoverride": 10 + }}}}}`), } requestJson, _ := json.Marshal(request) diff --git a/openrtb_ext/imp_rubicon.go b/openrtb_ext/imp_rubicon.go index 17585a8ee93..ee43d9659b8 100644 --- a/openrtb_ext/imp_rubicon.go +++ b/openrtb_ext/imp_rubicon.go @@ -27,5 +27,5 @@ type rubiconVideoParams struct { // rubiconVideoParams defines the contract for bidrequest.imp[i].ext.rubicon.debug type impExtRubiconDebug struct { - CpmOverride float64 `json:"cpmOverride,omitempty"` + CpmOverride float64 `json:"cpmoverride,omitempty"` }