Skip to content

Commit

Permalink
Made changes regarding GitHub reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
pixfuture-media committed Feb 14, 2025
1 parent f1b859c commit 025a574
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 61 deletions.
22 changes: 2 additions & 20 deletions adapters/pixfuture/pixfuture.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,10 @@ func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server co
func (a *adapter) MakeRequests(bidRequest *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
var errs []error

Check failure on line 29 in adapters/pixfuture/pixfuture.go

View workflow job for this annotation

GitHub Actions / validate-merge

declared and not used: errs

Check failure on line 29 in adapters/pixfuture/pixfuture.go

View workflow job for this annotation

GitHub Actions / validate (1.22.x, ubuntu-20.04)

errs declared and not used

Check failure on line 29 in adapters/pixfuture/pixfuture.go

View workflow job for this annotation

GitHub Actions / validate (1.23.x, ubuntu-20.04)

declared and not used: errs

// Process impressions
var validImpressions []openrtb2.Imp
for i := range bidRequest.Imp {
imp := &bidRequest.Imp[i]
if imp.Banner == nil && imp.Video == nil {
errs = append(errs, fmt.Errorf("unsupported impression type for impID: %s", imp.ID))
continue
}
validImpressions = append(validImpressions, *imp)
}

if len(validImpressions) == 0 {
errs = append(errs, errors.New("no valid impressions after filtering"))
return nil, errs
}

// Create the outgoing request
bidRequest.Imp = validImpressions
body, err := jsonutil.Marshal(bidRequest)
if err != nil {
errs = append(errs, fmt.Errorf("failed to marshal bid request: %w", err))
return nil, errs
return nil, []error{fmt.Errorf("failed to marshal bid request: %w", err)}
}

request := &adapters.RequestData{
Expand All @@ -61,7 +43,7 @@ func (a *adapter) MakeRequests(bidRequest *openrtb2.BidRequest, reqInfo *adapter
},
}

return []*adapters.RequestData{request}, errs
return []*adapters.RequestData{request}, nil
}

// getMediaTypeForBid extracts the bid type based on the bid extension data.
Expand Down
25 changes: 0 additions & 25 deletions coverage.out

This file was deleted.

2 changes: 1 addition & 1 deletion openrtb_ext/imp_pixfuture.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package openrtb_ext

type ImpExtPixfuture struct {
PlacementID string `json:"pix_id"`
PixID string `json:"pix_id"`
}
30 changes: 15 additions & 15 deletions static/bidder-params/pixfuture.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "PixFuture Adapter Params",
"description": "A schema which validates params accepted by the PixFuture adapter",
"type": "object",
"properties": {
"pix_id": {
"type": "string",
"description": "PixFuture placement ID",
"minLength": 3
}
},
"required": ["pix_id"]
}
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "PixFuture Adapter Params",
"description": "A schema which validates params accepted by the PixFuture adapter",
"type": "object",
"properties": {
"pix_id": {
"type": "string",
"description": "PixFuture placement ID",
"minLength": 3
}
},
"required": [
"pix_id"
]
}

0 comments on commit 025a574

Please sign in to comment.