{"action":"closed","issue":{"url":"https://api.github.com/repos/google/openrtb/issues/69","labels_url":"https://api.github.com/repos/google/openrtb/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/google/openrtb/issues/69/comments","events_url":"https://api.github.com/repos/google/openrtb/issues/69/events","html_url":"https://github.com/google/openrtb/issues/69","id":117439343,"number":69,"title":"Exchange-specific AdUnitId causes NullPointerException","user":{"login":"bryanwagner","id":4308569,"avatar_url":"https://avatars.githubusercontent.com/u/4308569?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanwagner","html_url":"https://github.com/bryanwagner","followers_url":"https://api.github.com/users/bryanwagner/followers","following_url":"https://api.github.com/users/bryanwagner/following{/other_user}","gists_url":"https://api.github.com/users/bryanwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanwagner/subscriptions","organizations_url":"https://api.github.com/users/bryanwagner/orgs","repos_url":"https://api.github.com/users/bryanwagner/repos","events_url":"https://api.github.com/users/bryanwagner/events{/privacy}","received_events_url":"https://api.github.com/users/bryanwagner/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-17T20:10:25Z","updated_at":"2015-11-17T21:14:26Z","closed_at":"2015-11-17T21:14:26Z","body":"The OpenRTB Native Ads Specification 1.0 defines `adunit` as an integer value referencing section 7.2 Native Ad Unit IDs, which defines integer values 500 and above as \"Reserved for Exchange specific formats\".  In the openrtb library this integer is implemented as a protobuf enum up to value 5 (there is a comment in the protobuf acknowledging the specification values of 500 and above).  When exchange-specific integer values are parsed by the library, the parse fails with a `NullPointerException`.  While this is correct according to the protobuf implementation, it is incorrect with respect to the OpenRTB specification.  There are several other fields following the same pattern.\r\n\r\nSince we have partners using these exchange-specific values, I was tempted to create a pull request with a fix, but I realized it's more of a design-level issue.  One workaround could be to add an optional int32 to the protobuf for these fields named `exchAdunit` for example.  Doing so, however, would require a modification to the JSON parse that would need to consider both the `adunit` and this new value in serialization/deserialization, most likely giving priority to the presence of the defined enums.\r\n\r\nI'm interested in knowing what the preferred direction would be for a bug fix; I would say it's a bug due to the declaration in the specification."}}