Skip to content

Commit

Permalink
Omit empty on 'Target json.RawMessage' to avoid sending invalid json …
Browse files Browse the repository at this point in the history
…in bid request (#968)

* Omitempty on 'Target json.RawMessage' to avoid sending invalid in bid request

* Omit empty additional fields
  • Loading branch information
potatogopher authored and mansinahar committed Jul 19, 2019
1 parent 6b20110 commit 7374057
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions adapters/rubicon/rubicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type rubiconParams struct {
AccountId int `json:"accountId"`
SiteId int `json:"siteId"`
ZoneId int `json:"zoneId"`
Inventory json.RawMessage `json:"inventory"`
Visitor json.RawMessage `json:"visitor"`
Inventory json.RawMessage `json:"inventory,omitempty"`
Visitor json.RawMessage `json:"visitor,omitempty"`
Video rubiconVideoParams `json:"video"`
}

Expand All @@ -53,7 +53,7 @@ type rubiconImpExtRPTrack struct {

type rubiconImpExtRP struct {
ZoneID int `json:"zone_id"`
Target json.RawMessage `json:"target"`
Target json.RawMessage `json:"target,omitempty"`
Track rubiconImpExtRPTrack `json:"track"`
}

Expand All @@ -62,7 +62,7 @@ type rubiconImpExt struct {
}

type rubiconUserExtRP struct {
Target json.RawMessage `json:"target"`
Target json.RawMessage `json:"target,omitempty"`
}

type rubiconExtUserTpID struct {
Expand Down
2 changes: 1 addition & 1 deletion openrtb_ext/bid_response_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "encoding/json"

type BidResponseVideo struct {
AdPods []*AdPod `json:"adPods"`
Ext json.RawMessage `json:"ext"`
Ext json.RawMessage `json:"ext,omitempty"`
}

type AdPod struct {
Expand Down
4 changes: 2 additions & 2 deletions openrtb_ext/imp_rubicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ type ExtImpRubicon struct {
AccountId int `json:"accountId"`
SiteId int `json:"siteId"`
ZoneId int `json:"zoneId"`
Inventory json.RawMessage `json:"inventory"`
Visitor json.RawMessage `json:"visitor"`
Inventory json.RawMessage `json:"inventory,omitempty"`
Visitor json.RawMessage `json:"visitor,omitempty"`
Video rubiconVideoParams `json:"video"`
}

Expand Down

0 comments on commit 7374057

Please sign in to comment.