Skip to content

Construct a bid request type correct on readme #58

Description

@JaosnHsieh

Validation schema is correct but the sample code on README is wrong type.

Construct a bid request

  var bidRequestBuilder = openrtb.getBuilder({
    builderType: 'bidRequest'
  });
  var bidRequest = bidRequestBuilder
  .timestamp(moment.utc().format())
  .id('1234')
  .at(2)
  .imp([
    {
      "id":"1",
      "native":{
        "request": {
          "ver": 1,
          "layout": 6,
          "assets": [
            { "id": 0, "req": 1, "title": { "len": 25 } }, 
            { "id": 1, "req": 1, "img": { "type": 3, "wmin": 100, "hmin": 100 } },
            { "id": 3, "req": 0, "data": { "type": 2, "len": 90 } }
          ]
        }
      },
...

to

Construct a bid request

  var bidRequestBuilder = openrtb.getBuilder({
    builderType: 'bidRequest'
  });
  var bidRequest = bidRequestBuilder
  .timestamp(moment.utc().format())
  .id('1234')
  .at(2)
  .imp([
    {
      "id":"1",
      "native":{
        "request": JSON.stringify({
          "ver": 1,
          "layout": 6,
          "assets": [
            { "id": 0, "req": 1, "title": { "len": 25 } }, 
            { "id": 1, "req": 1, "img": { "type": 3, "wmin": 100, "hmin": 100 } },
            { "id": 3, "req": 0, "data": { "type": 2, "len": 90 } }
          ]
        })
      },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions