Skip to content

Commit

Permalink
pubmatic: remove req.ext.prebid from pubmatic adapter request
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-viral-vala committed Dec 6, 2024
1 parent b962448 commit ba4567c
Show file tree
Hide file tree
Showing 20 changed files with 16 additions and 99 deletions.
2 changes: 0 additions & 2 deletions adapters/pubmatic/pubmatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ type extRequestAdServer struct {
Wrapper *pubmaticWrapperExt `json:"wrapper,omitempty"`
Acat []string `json:"acat,omitempty"`
Marketplace *marketplaceReqExt `json:"marketplace,omitempty"`
openrtb_ext.ExtRequest
}

type respExt struct {
Expand Down Expand Up @@ -351,7 +350,6 @@ func extractPubmaticExtFromRequest(request *openrtb2.BidRequest) (extRequestAdSe
if err != nil {
return pmReqExt, fmt.Errorf("error decoding Request.ext : %s", err.Error())
}
pmReqExt.ExtRequest = *reqExt

reqExtBidderParams := make(map[string]json.RawMessage)
if reqExt.Prebid.BidderParams != nil {
Expand Down
31 changes: 2 additions & 29 deletions adapters/pubmatic/pubmatic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,8 @@ func TestExtractPubmaticExtFromRequest(t *testing.T) {
Ext: json.RawMessage(`{"prebid":{"bidderparams":{}}}`),
},
},
expectedReqExt: extRequestAdServer{
ExtRequest: openrtb_ext.ExtRequest{
Prebid: openrtb_ext.ExtRequestPrebid{
BidderParams: json.RawMessage("{}"),
},
},
},
wantErr: false,
expectedReqExt: extRequestAdServer{},
wantErr: false,
},
{
name: "Only Pubmatic wrapper ext present",
Expand All @@ -215,11 +209,6 @@ func TestExtractPubmaticExtFromRequest(t *testing.T) {
},
expectedReqExt: extRequestAdServer{
Wrapper: &pubmaticWrapperExt{ProfileID: 123, VersionID: 456},
ExtRequest: openrtb_ext.ExtRequest{
Prebid: openrtb_ext.ExtRequestPrebid{
BidderParams: json.RawMessage(`{"wrapper":{"profile":123,"version":456}}`),
},
},
},
wantErr: false,
},
Expand All @@ -242,11 +231,6 @@ func TestExtractPubmaticExtFromRequest(t *testing.T) {
expectedReqExt: extRequestAdServer{
Wrapper: &pubmaticWrapperExt{ProfileID: 123, VersionID: 456},
Acat: []string{"drg", "dlu", "ssr"},
ExtRequest: openrtb_ext.ExtRequest{
Prebid: openrtb_ext.ExtRequestPrebid{
BidderParams: json.RawMessage(`{"acat":[" drg \t","dlu","ssr"],"wrapper":{"profile":123,"version":456}}`),
},
},
},
wantErr: false,
},
Expand All @@ -259,11 +243,6 @@ func TestExtractPubmaticExtFromRequest(t *testing.T) {
},
expectedReqExt: extRequestAdServer{
Wrapper: &pubmaticWrapperExt{ProfileID: 123, VersionID: 456},
ExtRequest: openrtb_ext.ExtRequest{
Prebid: openrtb_ext.ExtRequestPrebid{
BidderParams: json.RawMessage(`{"acat":[1,3,4],"wrapper":{"profile":123,"version":456}}`),
},
},
},
wantErr: true,
},
Expand All @@ -277,12 +256,6 @@ func TestExtractPubmaticExtFromRequest(t *testing.T) {
expectedReqExt: extRequestAdServer{
Marketplace: &marketplaceReqExt{AllowedBidders: []string{"pubmatic", "groupm"}},
Wrapper: &pubmaticWrapperExt{ProfileID: 123, VersionID: 456},
ExtRequest: openrtb_ext.ExtRequest{
Prebid: openrtb_ext.ExtRequestPrebid{
BidderParams: json.RawMessage(`{"wrapper":{"profile":123,"version":456}}`),
AlternateBidderCodes: &openrtb_ext.ExtAlternateBidderCodes{Enabled: true, Bidders: map[string]openrtb_ext.ExtAdapterAlternateBidderCodes{"pubmatic": {Enabled: true, AllowedBidderCodes: []string{"groupm"}}}},
},
},
},
wantErr: false,
},
Expand Down
10 changes: 2 additions & 8 deletions adapters/pubmatic/pubmatictest/exemplary/banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
"id": "1234"
}
}
},

},
"httpCalls": [
{
"expectedRequest": {
Expand Down Expand Up @@ -89,12 +88,7 @@
"profile": 5123,
"version":1
},
"acat": ["drg","dlu","ssr"],
"prebid": {
"bidderparams": {
"acat": ["drg","dlu","ssr"]
}
}
"acat": ["drg","dlu","ssr"]
}
},
"impIDs":["test-imp-id"]
Expand Down
2 changes: 1 addition & 1 deletion adapters/pubmatic/pubmatictest/exemplary/fledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
}
],
"ext": {"prebid":{}}
"ext": {}
},
"impIDs":["test-imp-id"]
},
Expand Down
3 changes: 1 addition & 2 deletions adapters/pubmatic/pubmatictest/exemplary/native.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-native-imp"]
Expand Down
8 changes: 1 addition & 7 deletions adapters/pubmatic/pubmatictest/exemplary/video.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
}
}
},

"httpCalls": [
{
"expectedRequest": {
Expand Down Expand Up @@ -100,12 +99,7 @@
"profile": 5123,
"version":1
},
"acat": ["drg","dlu","ssr"],
"prebid": {
"bidderparams": {
"acat": ["drg","dlu","ssr"]
}
}
"acat": ["drg","dlu","ssr"]
}
},
"impIDs":["test-video-imp"]
Expand Down
4 changes: 1 addition & 3 deletions adapters/pubmatic/pubmatictest/supplemental/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
}
}
},

"httpCalls": [
{
"expectedRequest": {
Expand Down Expand Up @@ -81,8 +80,7 @@
"wrapper": {
"profile": 5123,
"version":1
},
"prebid": {}
}
}
},
"impIDs":["app-imp"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-imp-id"]
Expand Down
17 changes: 0 additions & 17 deletions adapters/pubmatic/pubmatictest/supplemental/extra-bid.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
}
}
},

"httpCalls": [
{
"expectedRequest": {
Expand Down Expand Up @@ -103,22 +102,6 @@
"acat": ["drg","dlu","ssr"],
"marketplace": {
"allowedbidders": ["pubmatic", "groupm"]
},
"prebid": {
"bidderparams": {
"acat": ["drg","dlu","ssr"]
},
"alternatebiddercodes": {
"enabled": true,
"bidders": {
"pubmatic": {
"enabled": true,
"allowedbiddercodes": [
"groupm"
]
}
}
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-imp-id"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-imp-id"]
Expand Down
1 change: 0 additions & 1 deletion adapters/pubmatic/pubmatictest/supplemental/impExt.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
}
},
"ext": {
"prebid": {},
"wrapper": {
"profile": 5123,
"version": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
}
}
},

"expectedMakeRequestsErrors": [
{
"value": "Invalid adSlot AdTag_Div1@",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"id": "siteID"
}
},

"httpCalls": [
{
"expectedRequest": {
Expand Down Expand Up @@ -54,9 +53,7 @@
"id": "999"
}
},
"ext" : {
"prebid": {}
}
"ext" : {}
},
"impIDs":["multiple-media-imp"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
}
},
"ext": {
"prebid": {},
"wrapper": {
"profile": 5123,
"version": 1
Expand Down
3 changes: 1 addition & 2 deletions adapters/pubmatic/pubmatictest/supplemental/nilReqExt.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-imp-id"]
Expand Down
4 changes: 1 addition & 3 deletions adapters/pubmatic/pubmatictest/supplemental/noAdSlot.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
}
}
},

"httpCalls": [{
"expectedRequest": {
"uri": "https://hbopenbid.pubmatic.com/translator?source=prebid-server",
Expand Down Expand Up @@ -72,8 +71,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-imp-id"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-imp-id"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@
"wrapper": {
"profile": 1234,
"version": 2
},
"prebid": {
"bidderparams": {
"wrapper": {
"profile": 1234,
"version": 2
}
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@
"wrapper": {
"profile": 5123,
"version": 1
},
"prebid": {}
}
}
},
"impIDs":["test-imp-id"]
Expand Down

0 comments on commit ba4567c

Please sign in to comment.