Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Unable to use extensions 'ext' #160

Open
ranjithv opened this issue Dec 23, 2021 · 0 comments
Open

Unable to use extensions 'ext' #160

ranjithv opened this issue Dec 23, 2021 · 0 comments

Comments

@ranjithv
Copy link

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'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant