From 73740571a46f478d5226b50cecee04d96bcf8a17 Mon Sep 17 00:00:00 2001 From: Nick Rucci Date: Fri, 19 Jul 2019 13:43:11 -0600 Subject: [PATCH] Omit empty on 'Target json.RawMessage' to avoid sending invalid json in bid request (#968) * Omitempty on 'Target json.RawMessage' to avoid sending invalid in bid request * Omit empty additional fields --- adapters/rubicon/rubicon.go | 8 ++++---- openrtb_ext/bid_response_video.go | 2 +- openrtb_ext/imp_rubicon.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/adapters/rubicon/rubicon.go b/adapters/rubicon/rubicon.go index 89ccbbef3d1..01df397b503 100644 --- a/adapters/rubicon/rubicon.go +++ b/adapters/rubicon/rubicon.go @@ -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"` } @@ -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"` } @@ -62,7 +62,7 @@ type rubiconImpExt struct { } type rubiconUserExtRP struct { - Target json.RawMessage `json:"target"` + Target json.RawMessage `json:"target,omitempty"` } type rubiconExtUserTpID struct { diff --git a/openrtb_ext/bid_response_video.go b/openrtb_ext/bid_response_video.go index 058d06c30f9..4c123498ec8 100644 --- a/openrtb_ext/bid_response_video.go +++ b/openrtb_ext/bid_response_video.go @@ -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 { diff --git a/openrtb_ext/imp_rubicon.go b/openrtb_ext/imp_rubicon.go index f15b400c3b9..d588af82184 100644 --- a/openrtb_ext/imp_rubicon.go +++ b/openrtb_ext/imp_rubicon.go @@ -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"` }