Skip to content

Commit

Permalink
oms: added tests for invalid params, changed json marshal package, ch…
Browse files Browse the repository at this point in the history
…anged uri builder
  • Loading branch information
denis-s-oms committed Feb 2, 2025
1 parent a858a3f commit 40801cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adapters/oms/oms.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
var publisherID string
if len(request.Imp[0].Ext) > 0 {
ext := pbsExt{}
err = json.Unmarshal(request.Imp[0].Ext, &ext)
err = jsonutil.Unmarshal(request.Imp[0].Ext, &ext)
if err != nil {
return nil, []error{err}
}
Expand All @@ -58,7 +58,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte

requestData := &adapters.RequestData{
Method: "POST",
Uri: a.endpoint + fmt.Sprintf("?publisherId=%v", publisherID),
Uri: fmt.Sprintf("%s?publisherId=%v", a.endpoint, publisherID),
Body: requestJSON,
ImpIDs: openrtb_ext.GetImpIDs(request.Imp),
}
Expand Down Expand Up @@ -94,6 +94,7 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R
if len(response.Cur) == 0 {
bidResponse.Currency = response.Cur
}

for _, seatBid := range response.SeatBid {
for i := range seatBid.Bid {
bidType := getBidType(seatBid.Bid[i].MType)
Expand Down
1 change: 1 addition & 0 deletions adapters/oms/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ var invalidParams = []string{
`{}`,
`{"pid": "0"}`,
`{"publisherId": 9999}`,
`{"publisherId": "99999"}`,
}

0 comments on commit 40801cc

Please sign in to comment.