New Adapter: Aniview - #4852
Conversation
|
|
||
| for _, imp := range request.Imp { | ||
| if imp.ID == bid.ImpID { | ||
| if imp.Video != nil { |
There was a problem hiding this comment.
Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeVideo, nil. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
| if imp.Video != nil { | ||
| return openrtb_ext.BidTypeVideo, nil | ||
| } | ||
| if imp.Banner != nil { |
There was a problem hiding this comment.
Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeBanner, nil. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
| endpoint: "https://rtb.aniview.com/sspRTB2" | ||
| maintainer: | ||
| email: "support@aniview.com" | ||
| gvlVendorID: 780 |
| @@ -0,0 +1,18 @@ | |||
| endpoint: "https://rtb.aniview.com/sspRTB2" | |||
| @@ -0,0 +1,18 @@ | |||
| endpoint: "https://rtb.aniview.com/sspRTB2" | |||
| maintainer: | |||
| email: "support@aniview.com" | |||
There was a problem hiding this comment.
waiting for response
| var requests []*adapters.RequestData | ||
| var errors []error | ||
|
|
||
| headers := http.Header{} |
There was a problem hiding this comment.
http.Header is a map[string][]string — a reference type. Creating it once outside the loop and assigning it to every RequestData.Headers means all outgoing requests share the same map. If PBS or any middleware mutates one request's headers (e.g. adds a correlation ID), it silently modifies every other request in the batch.
Please create a fresh http.Header{} per RequestData, inside the inner loop:
headers := http.Header{}
headers.Add("Content-Type", "application/json;charset=utf-8")
headers.Add("Accept", "application/json")
requests = append(requests, &adapters.RequestData{
...
Headers: headers,
})| return nil, &errortypes.BadInput{ | ||
| Message: fmt.Sprintf("Missing AV_CHANNELID for imp: %s", imp.ID), | ||
| } | ||
| } |
There was a problem hiding this comment.
adapters.CheckResponseStatusCodeForErrors already returns the right typed error — BadInput for 400 and BadServerResponse for everything else (500, 503, etc.). The current code discards that typed error and always wraps a new errortypes.BadInput, so a 500 response from the exchange is misclassified as a buyer error.
Please just propagate the helper's return value:
if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil {
return nil, []error{err}
}
| "minLength": 1 | ||
| } | ||
| }, | ||
| "required": [ |
There was a problem hiding this comment.
PBS convention requires "additionalProperties": false in every bidder-params schema. Without it the validator silently accepts objects with misspelled or unknown fields (e.g. "AV_CHANNELID_TYPO": "…" passes validation even though the adapter never reads it).
Please add it after the required block:
"required": ["AV_PUBLISHERID", "AV_CHANNELID"],
"additionalProperties": false
Code coverage summaryNote:
aniviewRefer here for heat map coverage report |
…rict params schema
|
@przemkaczmarek thanks for the review. All the issues have been resolved. |
Code coverage summaryNote:
aniviewRefer here for heat map coverage report |
floxis-admin
left a comment
There was a problem hiding this comment.
Reviewing as another adapter submitter. One issue, plus a follow-on that's specific to your param naming.
"additionalProperties": false in static/bidder-params/aniview.json aborts the whole auction, not just your bidder
A bidder-params schema failure returns a plain fmt.Errorf at ortb/request_validator.go:133. errortypes.isFatal treats any error not implementing Coder as fatal (return !ok || ...), so endpoints/openrtb2/auction.go:935 hits ContainsFatalError and returns immediately — the entire bid request 400s for every bidder on the page. Every sibling branch in that same function does the soft thing instead (append(errL, ...) + delete(prebid.Bidder, bidder)); the schema path is the one that's fatal.
So any publisher who carries one extra key in bid.params loses their whole auction. Prebid.js copies bid.params verbatim into imp.ext.prebid.bidder.aniview under s2s, so extra keys are common. Only 2 of 269 schemas on master set this. (We shipped the same thing and it went unnoticed for weeks — that's why I spotted it.)
If you drop it, watch out for the case-sensitivity gap — it bites your params harder than most
Your params are AV_PUBLISHERID / AV_CHANNELID. JSON Schema property names are case-sensitive, but Go's JSON unmarshalling is case-insensitive. Today additionalProperties: false is what rejects av_publisherid; once it's gone, that key passes schema validation untouched (it matches no declared property, so minLength: 1 never runs) and Go still binds it into your struct.
That's mostly harmless for an ID, but it means the schema's minLength/required guarantees quietly stop applying to any case variant. Worth a non-empty check on both fields in MakeRequests after unmarshal if you drop the flag. We hit precisely this — in our case the ungated value was interpolated into a hostname, which was a good deal worse.
|
@przemkaczmarek you asked me to add One unrecognised key in
@floxis-admin thanks, good catch on On the case-sensitivity follow-on, one correction and then a reason I don't think the extra checks buy us anything. The correction: A lowercase-only payload never reaches the adapter either way, so removing the flag opens no hole there. Where you're right: the gap is a payload carrying both casings, and there
Why no new check: So the non-empty guarantee is already restored for the field we actually use. |
Code coverage summaryNote:
aniviewRefer here for heat map coverage report |
|
@floxis-admin please check my previous message when you have time. Thanks! |



Docs PR - prebid/prebid.github.io#6656