From e4bd6d3675111a973c100694af84f6764fc21f1e Mon Sep 17 00:00:00 2001 From: gg-natalia <148577437+gg-natalia@users.noreply.github.com> Date: Sun, 18 Aug 2024 06:52:28 -0300 Subject: [PATCH] ADTS-455 remove video validations (#3842) authored by @gg-natalia --- adapters/gumgum/gumgum.go | 15 +--- .../supplemental/missing-video-params.json | 36 --------- .../supplemental/video-missing-size.json | 35 --------- .../supplemental/video-partial-size.json | 77 +++++++++++++++++- .../supplemental/video-zero-size.json | 78 ++++++++++++++++++- 5 files changed, 148 insertions(+), 93 deletions(-) delete mode 100644 adapters/gumgum/gumgumtest/supplemental/missing-video-params.json delete mode 100644 adapters/gumgum/gumgumtest/supplemental/video-missing-size.json diff --git a/adapters/gumgum/gumgum.go b/adapters/gumgum/gumgum.go index 9e25e291825..4e44aacb82e 100644 --- a/adapters/gumgum/gumgum.go +++ b/adapters/gumgum/gumgum.go @@ -161,12 +161,8 @@ func preprocess(imp *openrtb2.Imp) (*openrtb_ext.ExtImpGumGum, error) { } if imp.Video != nil { - err := validateVideoParams(imp.Video) - if err != nil { - return nil, err - } - if gumgumExt.IrisID != "" { + var err error videoCopy := *imp.Video videoExt := openrtb_ext.ExtImpGumGumVideo{IrisID: gumgumExt.IrisID} videoCopy.Ext, err = json.Marshal(&videoExt) @@ -221,15 +217,6 @@ func getMediaTypeForImpID(impID string, imps []openrtb2.Imp) openrtb_ext.BidType return openrtb_ext.BidTypeVideo } -func validateVideoParams(video *openrtb2.Video) (err error) { - if video.W == nil || *video.W == 0 || video.H == nil || *video.H == 0 || video.MinDuration == 0 || video.MaxDuration == 0 || video.Placement == 0 || video.Linearity == 0 { - return &errortypes.BadInput{ - Message: "Invalid or missing video field(s)", - } - } - return nil -} - // Builder builds a new instance of the GumGum adapter for the given bidder with the given config. func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { bidder := &adapter{ diff --git a/adapters/gumgum/gumgumtest/supplemental/missing-video-params.json b/adapters/gumgum/gumgumtest/supplemental/missing-video-params.json deleted file mode 100644 index b2475cd7bb4..00000000000 --- a/adapters/gumgum/gumgumtest/supplemental/missing-video-params.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "mimes": [ - "video/mp4" - ], - "protocols": [ - 1, - 2 - ], - "w": 640, - "h": 480, - "startdelay": 1, - "placement": 1, - "linearity": 1 - }, - "ext": { - "bidder": { - "zone": "ggumtest" - } - } - } - ] - }, - "expectedMakeRequestsErrors": [ - { - "value": "Invalid or missing video field(s)", - "comparison": "literal" - } - ] - } - \ No newline at end of file diff --git a/adapters/gumgum/gumgumtest/supplemental/video-missing-size.json b/adapters/gumgum/gumgumtest/supplemental/video-missing-size.json deleted file mode 100644 index 1e4afe167ea..00000000000 --- a/adapters/gumgum/gumgumtest/supplemental/video-missing-size.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2 - ], - "startdelay": 1, - "placement": 1, - "linearity": 1 - }, - "ext": { - "bidder": { - "zone": "ggumtest" - } - } - } - ] - }, - "expectedMakeRequestsErrors": [ - { - "value": "Invalid or missing video field(s)", - "comparison": "literal" - } - ] -} \ No newline at end of file diff --git a/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json b/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json index 3c9727a1a9c..ce43a93b145 100644 --- a/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json +++ b/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json @@ -27,10 +27,79 @@ } ] }, - "expectedMakeRequestsErrors": [ + "httpCalls": [ { - "value": "Invalid or missing video field(s)", - "comparison": "literal" + "expectedRequest": { + "uri": "https://g2.gumgum.com/providers/prbds2s/bid", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2 + ], + "w": 640, + "startdelay": 1, + "placement": 1, + "linearity": 1 + }, + "ext": { + "bidder": { + "zone": "ggumtest" + } + } + } + ] + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "seatbid": [ + { + "bid": [ + { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + } + ] + } + ] + } + } + } +], +"expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + }, + "type": "video" + } + ] } - ] +] } \ No newline at end of file diff --git a/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json b/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json index d3d4b427120..4fc7dc3ce77 100644 --- a/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json +++ b/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json @@ -28,10 +28,80 @@ } ] }, - "expectedMakeRequestsErrors": [ + "httpCalls": [ { - "value": "Invalid or missing video field(s)", - "comparison": "literal" + "expectedRequest": { + "uri": "https://g2.gumgum.com/providers/prbds2s/bid", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2 + ], + "w": 0, + "h": 0, + "startdelay": 1, + "placement": 1, + "linearity": 1 + }, + "ext": { + "bidder": { + "zone": "ggumtest" + } + } + } + ] + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "seatbid": [ + { + "bid": [ + { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + } + ] + } + ] + } + } + } +], +"expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + }, + "type": "video" + } + ] } - ] +] } \ No newline at end of file