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 2305b14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 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

0 comments on commit 2305b14

Please sign in to comment.