adzerk / adzerk-ios-sdk

Access Adzerk's ad serving APIs via iOS
https://www.adzerk.com
Other
9 stars 5 forks source link

additionalOptions on request are not working #34

Closed karnowski closed 3 years ago

karnowski commented 3 years ago

Background

In version 2.0 we added support for additionalOptions at the request level to support new parameters on the Kevel servers without having to change/update the iOS SDK. They are meant to be added to the request JSON at the top level.

For example, code like this:

var requestOpts = PlacementRequest<StandardPlacement>.Options()
requestOpts.additionalOptions = [
    "includePricingData": .boolean(true)
]

Should create a JSON payload like this:

{
  "placements" : [
    {
      "siteId" : 667480,
      "adTypes" : [5],
      "networkId" : 23,
      "divName" : "div0",
    }
  ],
  "includePricingData" : true
}

However, it's actually adding an additionalOptions section in the request payload, like this:

{
  "placements" : [
    {
      "siteId" : 667480,
      "adTypes" : [5],
      "networkId" : 23,
      "divName" : "div0",
    }
  ],
  "additionalOptions" : {
    "includePricingData" : true
  }  
}

Sadly, the Kevel servers don't understand that and are ignoring the includePricingData field.

Acceptance Criteria

Out of Scope

Note that there is a similar mechanism on each placement inside the request, and it is also not working correctly. However, we are tracking that as a separate issue, so it is out of scope.

karnowski commented 3 years ago

Related documentation: https://dev.kevel.co/reference/request