-
Notifications
You must be signed in to change notification settings - Fork 762
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
Nextmillennium: add extra_info support #3351
Nextmillennium: add extra_info support #3351
Conversation
Code coverage summaryNote:
nextmillenniumRefer here for heat map coverage report
|
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.
Looking good. Please add unit test coverage for passing in extraInfo and verifying it's included in the request to your servers. Something similar to huaweiads_test.go
would be great.
@@ -33,6 +33,7 @@ | |||
"body":{ | |||
"id": "testid", | |||
"ext": { | |||
"nextMillennium": {}, |
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.
Is it desired to send an empty object if the list is empty? If you add an omitempty flag to the json attribute you could skip creating an empty object (unless you need it on your side). ie:
NextMillennium nmExtNMM `json:"nextMillennium"`
to
NextMillennium nmExtNMM `json:"nextMillennium,omitempty"`
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.
I added a test case for extra_info,
When I add omitempty
it doesn't actually change anything... I always believed omitempty
only works on keys (meaning not objects) (or if it's a pointer...),
Either way, it doesn't bother us, so if it's ok with you, I would just leave 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.
omitempty
was added on NmmFlags
. But recommendation was to add omitempty on nextMillennium
type nmExtNMM struct {
- NmmFlags []string `json:"nmmFlags,omitempty"`
+ NmmFlags []string `json:"nmmFlags"`
}
type nextMillJsonExt struct {
Prebid nmExtPrebid `json:"prebid"`
Prebid nmExtPrebid `json:"prebid"`
- NextMillennium nmExtNMM `json:"nextMillennium"`
+ NextMillennium nmExtNMM `json:"nextMillennium,omitempty"`
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.
Hi @onkarvhanumante.
Thanks for clarifying.
I pushed another commit to add it. However, as far as I'm aware, adding omitempty on a type of struct makes no difference (the object itself will be empty but the nextMillennium key will still exist as an empty object).
The only way (from a quick google search) to remove it is to convert it to a pointer.
It is not important for us to remove it, but if for whatever reason you think I should do it, let me know and I'll do it.
Thank you!
Code coverage summaryNote:
nextmillenniumRefer here for heat map coverage report
|
Code coverage summaryNote:
nextmillenniumRefer here for heat map coverage report
|
Added the ability for users to pass custom flags using extra_info,