From c1eacedabd37cca89db2a7a8c9c6860efb1f22c3 Mon Sep 17 00:00:00 2001 From: yfcr Date: Tue, 14 Nov 2023 09:59:35 -0500 Subject: [PATCH] change bid type to use the openrtb_ext.BidTypeBanner literal --- adapters/oms/oms.go | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/adapters/oms/oms.go b/adapters/oms/oms.go index 17c33b371f3..2260ae1a98f 100644 --- a/adapters/oms/oms.go +++ b/adapters/oms/oms.go @@ -38,20 +38,6 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte return []*adapters.RequestData{requestData}, nil } -func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) { - if bid.Ext != nil { - var bidExt openrtb_ext.ExtBid - err := json.Unmarshal(bid.Ext, &bidExt) - if err == nil && bidExt.Prebid != nil { - return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) - } - } - - return "", &errortypes.BadServerResponse{ - Message: fmt.Sprintf("Failed to parse impression \"%s\" mediatype", bid.ImpID), - } -} - func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { if responseData.StatusCode == http.StatusNoContent { return nil, nil @@ -78,17 +64,11 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(request.Imp)) bidResponse.Currency = response.Cur - var errors []error for _, seatBid := range response.SeatBid { - for i, bid := range seatBid.Bid { - bidType, err := getMediaTypeForBid(bid) - if err != nil { - errors = append(errors, err) - continue - } + for i := range seatBid.Bid { bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ Bid: &seatBid.Bid[i], - BidType: bidType, + BidType: openrtb_ext.BidTypeBanner, }) } }