Skip to content

Commit

Permalink
Reverted generic definition of imp[].ext.data
Browse files Browse the repository at this point in the history
  • Loading branch information
sachin-pubmatic committed Jun 16, 2021
1 parent da1fac1 commit 958e16d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 0 additions & 1 deletion adapters/bidder.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ type ExtImpBidder struct {
// Bidder implementations may safely assume that this JSON has been validated by their
// static/bidder-params/{bidder}.json file.
Bidder json.RawMessage `json:"bidder"`
Data *openrtb_ext.ExtData `json:"data,omitempty"`
}

func (r *RequestData) SetBasicAuth(username string, password string) {
Expand Down
17 changes: 16 additions & 1 deletion adapters/pubmatic/pubmatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ type pubmaticBidExt struct {
VideoCreativeInfo *pubmaticBidExtVideo `json:"video,omitempty"`
}

type ExtImpBidderPubmatic struct {
adapters.ExtImpBidder
Data *ExtData `json:"data,omitempty"`
}

type ExtData struct {
AdServer *ExtAdServer `json:"adserver"`
PBAdSlot string `json:"pbadslot"`
}

type ExtAdServer struct {
Name string `json:"name"`
AdSlot string `json:"adslot"`
}

const (
INVALID_PARAMS = "Invalid BidParam"
MISSING_PUBID = "Missing PubID"
Expand Down Expand Up @@ -455,7 +470,7 @@ func parseImpressionObject(imp *openrtb2.Imp, wrapExt *string, pubID *string) er
imp.Audio = nil
}

var bidderExt adapters.ExtImpBidder
var bidderExt ExtImpBidderPubmatic
if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil {
return err
}
Expand Down
10 changes: 0 additions & 10 deletions openrtb_ext/imp.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,3 @@ type ExtImpPrebid struct {
type ExtStoredRequest struct {
ID string `json:"id"`
}

type ExtData struct {
AdServer *ExtAdServer `json:"adserver"`
PBAdSlot string `json:"pbadslot"`
}

type ExtAdServer struct {
Name string `json:"name"`
AdSlot string `json:"adslot"`
}

0 comments on commit 958e16d

Please sign in to comment.