-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(openrtb): Extension refactor part1 - BidRequest Device Impression #115
refactor(openrtb): Extension refactor part1 - BidRequest Device Impression #115
Conversation
… differences between output and expected data.
… differences between output and expected data.
…m to json.RawMessage. Here are two reason to do that: 1: Avoid the loss of precise while unmarshal data to interface{}. See https://vungle.atlassian.net/browse/PBJ-3092 2: Avoid the change between interface{} and specified structs. Using json.RawMessage can make sure there is only one convert from the beginning.
Files changed in PR, revertig code review status. |
…keep unchanged. If we update one struct and use "make generate" to get the easyjson file, all file will be removed and regenerate. Here will be code redundant. E.g. while enerating Device, the framework will find its sub struct Geo, but Geo is after Device in alphabet order, so the easyjson framework will generate the code for Geo in device_easyjson.go. However, if we use the generate tools of Goland, that is the green triangle in the front of device.go file, the easyjson framework will use Geo.Marshal method there. In order to keep the code unchanged and make an uniform way to generate code, we use "make generate" command here.
Files changed in PR, revertig code review status. |
…e/vungo into wip-pbj-3419-raw-message-extension
openrtb/openrtbutil/request_test.go
Outdated
"localhost/#宝%贝%约%么%", | ||
reflect.TypeOf((*url.Error)(nil)), | ||
}, | ||
//{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Remove unused lines.
…ice-ext refactor(openrtb): Use json.RawMessage as the extension object part3 - Device
f1a808a
Files changed in PR, revertig code review status. |
Remove unused lines.
…ression-ext refactor(openrtb): Use json.RawMessage as the extension object part4- Impression
Update extension fields of BidRequest and its sub structs. Change them to json.RawMessage.
Here are two reason to do that:
1: Avoid the loss of precise while unmarshal data to interface{}. The build-in json and easyjson both use the type of float64 to parse a number in json string. If it is an int64 number, some information will loss.
2: Avoid the change between interface{} and specified structs. Using json.RawMessage can make sure there is only one convert from the beginning.