Skip to content
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

Merged
merged 18 commits into from
May 9, 2022

Conversation

HaibinZhang-Vungle
Copy link
Contributor

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.

Vungo CI by Jenkins added 4 commits February 8, 2022 14:40
… 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.
@vungle-opsbot
Copy link

Files changed in PR, revertig code review status.

Vungo CI by Jenkins added 3 commits February 8, 2022 15:08
…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.
@vungle-opsbot
Copy link

Files changed in PR, revertig code review status.

@HaibinZhang-Vungle HaibinZhang-Vungle changed the title refactor(openrtb): Use json.RawMessage as the extension object of BidRequest. refactor(openrtb): Use json.RawMessage as the extension object part1 - BidRequest Apr 18, 2022
"localhost/#宝%贝%约%么%",
reflect.TypeOf((*url.Error)(nil)),
},
//{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Remove unused lines.

yingchen0706v
yingchen0706v previously approved these changes Apr 19, 2022
@HaibinZhang-Vungle HaibinZhang-Vungle changed the title refactor(openrtb): Use json.RawMessage as the extension object part1 - BidRequest refactor(openrtb): Use json.RawMessage as the extension object part2 - BidRequest Apr 20, 2022
…ice-ext

refactor(openrtb): Use json.RawMessage as the extension object part3 - Device
@vungle-opsbot
Copy link

Files changed in PR, revertig code review status.

Remove unused lines.
…ression-ext

refactor(openrtb): Use json.RawMessage as the extension object part4- Impression
@HaibinZhang-Vungle HaibinZhang-Vungle changed the title refactor(openrtb): Use json.RawMessage as the extension object part2 - BidRequest refactor(openrtb): Use json.RawMessage as the extension object part1 - BidRequest Device Impression Apr 29, 2022
@HaibinZhang-Vungle HaibinZhang-Vungle changed the title refactor(openrtb): Use json.RawMessage as the extension object part1 - BidRequest Device Impression refactor(openrtb): Extension refactor part1- BidRequest Device Impression Apr 29, 2022
@HaibinZhang-Vungle HaibinZhang-Vungle changed the title refactor(openrtb): Extension refactor part1- BidRequest Device Impression refactor(openrtb): Extension refactor part1 - BidRequest Device Impression Apr 29, 2022
@HaibinZhang-Vungle HaibinZhang-Vungle merged commit 618f1a3 into master May 9, 2022
@HaibinZhang-Vungle HaibinZhang-Vungle deleted the wip-pbj-3419-raw-message-extension branch May 9, 2022 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants