Skip to content
This repository was archived by the owner on Dec 22, 2022. It is now read-only.

Commit 3f69718

Browse files
potatogophermansinahar
authored andcommitted
Omit empty on 'Target json.RawMessage' to avoid sending invalid json in bid request (prebid#968)
* Omitempty on 'Target json.RawMessage' to avoid sending invalid in bid request * Omit empty additional fields
1 parent 6789104 commit 3f69718

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

adapters/rubicon/rubicon.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ type rubiconParams struct {
4141
AccountId int `json:"accountId"`
4242
SiteId int `json:"siteId"`
4343
ZoneId int `json:"zoneId"`
44-
Inventory json.RawMessage `json:"inventory"`
45-
Visitor json.RawMessage `json:"visitor"`
44+
Inventory json.RawMessage `json:"inventory,omitempty"`
45+
Visitor json.RawMessage `json:"visitor,omitempty"`
4646
Video rubiconVideoParams `json:"video"`
4747
}
4848

@@ -53,7 +53,7 @@ type rubiconImpExtRPTrack struct {
5353

5454
type rubiconImpExtRP struct {
5555
ZoneID int `json:"zone_id"`
56-
Target json.RawMessage `json:"target"`
56+
Target json.RawMessage `json:"target,omitempty"`
5757
Track rubiconImpExtRPTrack `json:"track"`
5858
}
5959

@@ -62,7 +62,7 @@ type rubiconImpExt struct {
6262
}
6363

6464
type rubiconUserExtRP struct {
65-
Target json.RawMessage `json:"target"`
65+
Target json.RawMessage `json:"target,omitempty"`
6666
}
6767

6868
type rubiconExtUserTpID struct {

openrtb_ext/bid_response_video.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "encoding/json"
44

55
type BidResponseVideo struct {
66
AdPods []*AdPod `json:"adPods"`
7-
Ext json.RawMessage `json:"ext"`
7+
Ext json.RawMessage `json:"ext,omitempty"`
88
}
99

1010
type AdPod struct {

openrtb_ext/imp_rubicon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ type ExtImpRubicon struct {
99
AccountId int `json:"accountId"`
1010
SiteId int `json:"siteId"`
1111
ZoneId int `json:"zoneId"`
12-
Inventory json.RawMessage `json:"inventory"`
13-
Visitor json.RawMessage `json:"visitor"`
12+
Inventory json.RawMessage `json:"inventory,omitempty"`
13+
Visitor json.RawMessage `json:"visitor,omitempty"`
1414
Video rubiconVideoParams `json:"video"`
1515
}
1616

0 commit comments

Comments
 (0)