google/openrtb

Unable to use extensions 'ext'

ranjithv opened this issue · 0 comments

Hi,
I'm working on a project and have extended BidRequest

import "openrtb.proto";
package com.company.project;
option java_outer_classname = "OpenRtbExt";

extend com.google.openrtb.BidRequest {
  optional string ext = 300;
}

I'm using springboot that has support for converting JSON to protobuf messages(ProtobufHttpMessageConverter). It works fine without using "ext" json key. If I uncomment "ext" in below json, I get below exception:
com.google.protobuf.InvalidProtocolBufferException: Cannot find field: ext in message com.google.openrtb.BidRequest

{
  "id": "000000000000000",
//   "ext": "Something",
  "imp": [
    {
      "id": "1",
      "native": {
        "request_native": {
          "ver": "1.2",
          "context": 2,
          "contextsubtype": 20,
          "plcmttype": 4,
          "plcmtcnt": 1,
          "aurlsupport": false,
          "privacy": true,
          "eventtrackers": [
            {
              "event": 1,
              "methods": [
                1,
                2
              ]
            },
            {
              "event": 2,
              "methods": [
                1
              ]
            }
          ],
          "assets": [
            {
              "id": 123,
              "required": true,
              "title": {
                "len": 140
              }
            },
            {
              "id": 128,
              "required": false,
              "img": {
                "wmin": 836,
                "hmin": 627,
                "type": 3
              }
            },
            {
              "id": 124,
              "required": true,
              "img": {
                "wmin": 50,
                "hmin": 50,
                "type": 1
              }
            },
            {
              "id": 4,
              "video": {
                "linearity": 1,
                "minduration": 15,
                "maxduration": 30,
                "protocols": [
                  2,
                  3
                ],
                "mimes": [
                  "video/mp4"
                ]
              }
            }
          ]
        }
      }
    }
  ]
}

Other related questions:

  • When is the plan to support proto3?
  • Why int fields from Native Ads spec 1.2 is using bool? Example 'required' is an optional int that is allowed 0 or 1. openrtb.proto defines this as bool so json expects it to be 'false'