google/openrtb

Exception for missing "id" even though "id" is present after the extension part

avitaleli opened this issue · 1 comments

Hi,

I have the following extension:

import "openrtb.proto";

option java_outer_classname = "BidRequestExt";

message Extension {
    optional Udi udi = 1;
}

message Udi {
    optional string googleadid = 2;
    optional string idfa = 3;
}

extend com.google.openrtb.BidRequest {
    optional Extension ext = 1009;
}

When I use the following request:
{"adSizeRequest":"320x480","app":{"bundle":"com.dupovalo.chiromancer","cat":["IAB1"],"domain":"play.google.com","id":"130070556","name":"Chiromancer_fullscreen_Android_IAB_FULL_SCREEN_320x480_IAB1","publisher":{"id":"1001000269","name":"Derived Set Ltd"}},"at":2,"bcat":["IAB17-18","IAB7-42","IAB23","IAB7-28","IAB26","IAB25","IAB9-9","IAB24"],"device":{"connectiontype":0,"devicetype":1,"dnt":0,"dpidmd5":"67b6f2c97185890bc71b4e510df6539e","dpidsha1":"8c9797e124359124342650a49ddf8746e72c0479","geo":{"city":"Salvador","country":"BRA","lat":-12.864865,"lon":-38.479427,"metro":"0","region":"Bahia","type":3,"zip":"41338"},"ip":"200.223.92.185","js":1,"make":"Samsung","model":"GT-S7273T","os":"Android","osv":"4.2","ua":"Mozilla/5.0 (Linux; U; Android 4.2.2; pt-br; GT-S7273T Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"},"ext":{"carriername":"unknown - probably WLAN","coppa":0,"operaminibrowser":0,"udi":{"androidid":"9f21ea9417a3e227","androididmd5":"67b6f2c97185890bc71b4e510df6539e","androididsha1":"8c9797e124359124342650a49ddf8746e72c0479","googleadid":"e74789d2-430e-4747-8740-96b27a5aa0f8","googlednt":0}},"id":"CiLnVi3dSE","imp":[{"banner":{"battr":[1,3,5,8,9],"h":480,"mimes":["application/javascript","image/gif","image/jpeg","image/png","text/html","text/javascript","text/plain"],"pos":0,"w":320},"displaymanager":"SOMA","ext":{"strictbannersize":1},"id":"1","instl":1,"tagid":"130070556"}],"user":{}}

I get an error
com.google.protobuf.UninitializedMessageException: Message missing required fields: id

However as you can see, I do have the id: "id":"CiLnVi3dSE",

If I change the order and I put the id ("id":"CiLnVi3dSE") before the entry for "ext" it works well:
{"id":"CiLnVi3dSE", "adSizeRequest":"320x480","app":{"bundle":"com.dupovalo.chiromancer","cat":["IAB1"],"domain":"play.google.com","id":"130070556","name":"Chiromancer_fullscreen_Android_IAB_FULL_SCREEN_320x480_IAB1","publisher":{"id":"1001000269","name":"Derived Set Ltd"}},"at":2,"bcat":["IAB17-18","IAB7-42","IAB23","IAB7-28","IAB26","IAB25","IAB9-9","IAB24"],"device":{"connectiontype":0,"devicetype":1,"dnt":0,"dpidmd5":"67b6f2c97185890bc71b4e510df6539e","dpidsha1":"8c9797e124359124342650a49ddf8746e72c0479","geo":{"city":"Salvador","country":"BRA","lat":-12.864865,"lon":-38.479427,"metro":"0","region":"Bahia","type":3,"zip":"41338"},"ip":"200.223.92.185","js":1,"make":"Samsung","model":"GT-S7273T","os":"Android","osv":"4.2","ua":"Mozilla/5.0 (Linux; U; Android 4.2.2; pt-br; GT-S7273T Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"},"ext":{"carriername":"unknown - probably WLAN","coppa":0,"operaminibrowser":0,"udi":{"androidid":"9f21ea9417a3e227","androididmd5":"67b6f2c97185890bc71b4e510df6539e","androididsha1":"8c9797e124359124342650a49ddf8746e72c0479","googleadid":"e74789d2-430e-4747-8740-96b27a5aa0f8","googlednt":0}},"imp":[{"banner":{"battr":[1,3,5,8,9],"h":480,"mimes":["application/javascript","image/gif","image/jpeg","image/png","text/html","text/javascript","text/plain"],"pos":0,"w":320},"displaymanager":"SOMA","ext":{"strictbannersize":1},"id":"1","instl":1,"tagid":"130070556"}],"user":{}}

Can you please help me why there is a problem regarding the order of the entries in the JSON?

Thank you

I found the problem, it was in my custom reader, I am closing this one.