From 0fb1b094db07d123a866b3b1d8e361ef8c19706c Mon Sep 17 00:00:00 2001 From: AdsInteractive Date: Wed, 15 Jan 2025 14:25:42 +0200 Subject: [PATCH] upds --- adapters/ads_interactive/ads_interactive.go | 9 +++++---- .../ads_interactivetest/supplemental/bad_response.json | 2 +- .../supplemental/no-valid-bidder-param.json | 2 +- .../supplemental/no-valid-imp-ext.json | 2 +- adapters/ads_interactive/params_test.go | 5 +++++ static/bidder-info/ads_interactive.yaml | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/adapters/ads_interactive/ads_interactive.go b/adapters/ads_interactive/ads_interactive.go index 3eaaca867a0..5b46ec52483 100644 --- a/adapters/ads_interactive/ads_interactive.go +++ b/adapters/ads_interactive/ads_interactive.go @@ -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 { @@ -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 } @@ -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} } diff --git a/adapters/ads_interactive/ads_interactivetest/supplemental/bad_response.json b/adapters/ads_interactive/ads_interactivetest/supplemental/bad_response.json index cd4169c9974..476058ed624 100644 --- a/adapters/ads_interactive/ads_interactivetest/supplemental/bad_response.json +++ b/adapters/ads_interactive/ads_interactivetest/supplemental/bad_response.json @@ -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" } ] diff --git a/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-bidder-param.json b/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-bidder-param.json index 533d21ac30a..fe0631c032a 100644 --- a/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-bidder-param.json +++ b/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-bidder-param.json @@ -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" } ] diff --git a/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-imp-ext.json b/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-imp-ext.json index 9d6710efe37..09108b2d847 100644 --- a/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-imp-ext.json +++ b/adapters/ads_interactive/ads_interactivetest/supplemental/no-valid-imp-ext.json @@ -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" } ] diff --git a/adapters/ads_interactive/params_test.go b/adapters/ads_interactive/params_test.go index 40265bf4c4d..ec7dc6302ee 100644 --- a/adapters/ads_interactive/params_test.go +++ b/adapters/ads_interactive/params_test.go @@ -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"}`, } diff --git a/static/bidder-info/ads_interactive.yaml b/static/bidder-info/ads_interactive.yaml index 0af275c1f34..dd857366b5d 100644 --- a/static/bidder-info/ads_interactive.yaml +++ b/static/bidder-info/ads_interactive.yaml @@ -1,4 +1,4 @@ -endpoint: "https://bntb.adsinteractive.com/" +endpoint: "https://bntb.adsinteractive.com/pserver" gvlVendorID: 1212 maintainer: email: "it@adsinteractive.com"