Skip to content

KRKPD-1035: Kargo Adapter Strict Type Checking#35

Closed
klawil wants to merge 4 commits intomasterfrom
KRKPD-1035-kargo-adapter-type-strict
Closed

KRKPD-1035: Kargo Adapter Strict Type Checking#35
klawil wants to merge 4 commits intomasterfrom
KRKPD-1035-kargo-adapter-type-strict

Conversation

@klawil
Copy link

@klawil klawil commented May 10, 2024

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Updated bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

Type checking was added to the values that are both user and prebid provided following an issue where validBidRequests[0].userId.tdid was an object instead of a string which caused our backend to return a 400 error.

We now check that the type of the input is of the type our API expects (or can be coerced to that type). If an invalid type is present, we report that information to the API in root.ext.krg.verr for alerting purposes. In some cases, we will also logError the correct format so publishers can see the issue.

As part of increasing the type strictness, we also now validate the placementId parameter more closely in isBidRequestValid making sure that it is present, is a string, and starts with _ (which all valid placementIds do).

Other information

Kargo ticket - KRKPD-1035

@klawil klawil changed the title Kargo Adapter Strict Type Checking KRKPD-1035: Kargo Adapter Strict Type Checking May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments