Skip to content

Commit

Permalink
Kargo: Normalize placementId naming (#2785)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsadwith committed May 23, 2023
1 parent 4b73740 commit df76979
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions adapters/kargo/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ func TestInvalidParams(t *testing.T) {
}

var validParams = []string{
`{"placementId": ""}`,
`{"placementId": "11523"}`,
`{"adSlotID": ""}`,
`{"adSlotID": "11523"}`,
}

var invalidParams = []string{
`{"placementId": 42}`,
`{"placementId": }`,
`{"placementID": "32321"}`,
`{"adSlotID": 42}`,
`{"adSlotID": }`,
`{"adSlotId": "32321"}`,
`{"id": }`,
`{}`,
`{"placementId": "11523", "adSlotID": "12345"}`, // Can't include both
}
3 changes: 2 additions & 1 deletion openrtb_ext/imp_kargo.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package openrtb_ext

type ImpExtKargo struct {
AdSlotID string `json:"adSlotID"`
PlacementId string `json:"placementId"`
AdSlotID string `json:"adSlotID"` // Deprecated - Use `placementId`
}
19 changes: 12 additions & 7 deletions static/bidder-params/kargo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
"title": "Kargo Adapter Params",
"description": "A schema which validates params accepted by the Kargo adapter",
"type": "object",

"properties": {
"adSlotID": {
"type": "string",
"description": "An ID which identifies the adslot placement. Equivalent to the id of target inventory, ad unit code, or placement id"
}
"placementId": {
"type": "string",
"description": "An ID which identifies the adslot placement. Equivalent to the id of target inventory, ad unit code, or placement id"
},

"required": ["adSlotID"]
"adSlotID": {
"type": "string",
"description": "[Deprecated: Use `placementId`] An ID which identifies the adslot placement. Equivalent to the id of target inventory, ad unit code, or placement id"
}
},
"oneOf": [
{ "required": ["placementId"] },
{ "required": ["adSlotID"] }
]
}

0 comments on commit df76979

Please sign in to comment.