Skip to content

Commit

Permalink
upds
Browse files Browse the repository at this point in the history
  • Loading branch information
AdsInteractive committed Jan 15, 2025
1 parent 3126205 commit 0fb1b09
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
9 changes: 5 additions & 4 deletions adapters/ads_interactive/ads_interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/prebid/prebid-server/v3/adapters"
"github.com/prebid/prebid-server/v3/config"
"github.com/prebid/prebid-server/v3/openrtb_ext"
"github.com/prebid/prebid-server/v3/util/jsonutil"
)

type adapter struct {
Expand Down Expand Up @@ -36,18 +37,18 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.E
var errs []error
var adapterRequests []*adapters.RequestData

reqCopy := *request
for _, imp := range request.Imp {
reqCopy := *request
reqCopy.Imp = []openrtb2.Imp{imp}

var bidderExt adapters.ExtImpBidder
var adsInteractiveExt openrtb_ext.ImpExtAdsInteractive

if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil {
if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil {
errs = append(errs, err)
continue
}
if err := json.Unmarshal(bidderExt.Bidder, &adsInteractiveExt); err != nil {
if err := jsonutil.Unmarshal(bidderExt.Bidder, &adsInteractiveExt); err != nil {
errs = append(errs, err)
continue
}
Expand Down Expand Up @@ -116,7 +117,7 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R
}

var response openrtb2.BidResponse
if err := json.Unmarshal(responseData.Body, &response); err != nil {
if err := jsonutil.Unmarshal(responseData.Body, &response); err != nil {
return nil, []error{err}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}],
"expectedMakeBidsErrors": [
{
"value": "json: cannot unmarshal string into Go value of type openrtb2.BidResponse",
"value": "expect { or n, but found \"",
"comparison": "literal"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"expectedMakeRequestsErrors": [
{
"value": "json: cannot unmarshal array into Go struct field ImpExtAdsInteractive.endpointId of type string",
"value": "cannot unmarshal openrtb_ext.ImpExtAdsInteractive.EndpointID: expects \" or n, but found [",
"comparison": "literal"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"expectedMakeRequestsErrors": [
{
"value": "json: cannot unmarshal string into Go value of type adapters.ExtImpBidder",
"value": "expect { or n, but found \"",
"comparison": "literal"
}
]
Expand Down
5 changes: 5 additions & 0 deletions adapters/ads_interactive/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ var validParams = []string{
`{"placementId": "1"}`,
`{"endpointId": "test"}`,
`{"endpointId": "1"}`,
`{"placementId": "test", "unknownField": "value"}`,
}

var invalidParams = []string{
`{}`,
`{"placementId": 42}`,
`{"endpointId": 42}`,
`{"placementId": "1", "endpointId": "1"}`,
`{"placementId": ""}`,
`{"endpointId": ""}`,
`{"randomField": "value"}`,
}
2 changes: 1 addition & 1 deletion static/bidder-info/ads_interactive.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
endpoint: "https://bntb.adsinteractive.com/"
endpoint: "https://bntb.adsinteractive.com/pserver"
gvlVendorID: 1212
maintainer:
email: "[email protected]"
Expand Down

0 comments on commit 0fb1b09

Please sign in to comment.