prebid / prebid-server-java

Java version of Prebid Server
Apache License 2.0
68 stars 175 forks source link

Validation doesn't allow stored impressions without bidders #2975

Open muuki88 opened 8 months ago

muuki88 commented 8 months ago

We faced an issue with stored impressions that are not configured, but requested and thus crash the entire auction.

https://github.com/prebid/prebid-server-java/blob/ed1baacf6d92fefd42d04b72192a7a6282941bd5/src/main/java/org/prebid/server/validation/RequestValidator.java#L995-L1001

This validation doesn't allow us to create a stored impression that looks like this

{
  "id" : "123/content_1",
  "banner" : {
    "format" : [  ]
  },
  "ext" : {  }
}

instead we have to do something like this

{
  "id" : "123/content_1",
  "banner" : {
    "format" : [ ]
  },
  "ext" : {
    "h5": {} // this bidder does not exist, but tricks the validation
  }
}

Proposal

It would be great to disable certain validations. E.g.

validations:
  allow:
    - empty-stored-impressions
bretg commented 8 months ago

@muuki88 - maybe we can just drop the whole validation? No clear to me that a validation like this is real valuable because it's already in the DB and this error isn't that much more helpful than just noticing that there aren't any bidders in the auction.

muuki88 commented 8 months ago

That would be even better IMHO. Because this escalates an error ( or purposely configured ad unit ) to the entire auction.

bretg commented 8 months ago

Care to submit a PR @muuki88 ?

muuki88 commented 8 months ago

Deleting code? Always 😍😎

bretg commented 1 month ago

Would like to discuss with the committee whether we should continue to hard-fail on missing imp[%d].ext.prebid.bidder.

We already have the scenario where bidders get removed due to lack of Purpose 2 consent - it's possible to take the view that the request/storedrequest should be allowed to not contain bidders.