-
Notifications
You must be signed in to change notification settings - Fork 193
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: Adapter and server version #3814
base: master
Are you sure you want to change the base?
NextMillennium: Adapter and server version #3814
Conversation
final ExtRequestPrebid updatedExt = extRequestPrebid.toBuilder() | ||
.nextMillennium(ExtRequestNextMillennium.of( | ||
nmmFlags, | ||
NM_ADAPTER_VERSION, | ||
versionProvider.getNameVersionRecord())) | ||
.build(); |
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.
In Go they don't update ext
or ext.prebid
, they create new objects
return bidRequest.toBuilder() | ||
.imp(bidRequest.getImp()) | ||
.ext(ExtRequest.of(updatedExt)) | ||
.build(); |
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.
imp[0].ext
update is missing
/** | ||
* Defines the contract for bidrequest.ext.prebid.nextMillennium | ||
*/ | ||
ExtRequestNextMillennium 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.
deserialization is incorrect here
@Value(staticConstructor = "of") | ||
public class ExtRequestNextMillennium { | ||
|
||
List<String> nmmFlags; |
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.
deserialization is incorrect here
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.
still incorrect, it should be nmmFlags
@Value(staticConstructor = "of") | ||
public class ExtRequestNextMillennium { | ||
|
||
List<String> nmmFlags; |
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.
still incorrect, it should be nmmFlags
List<String> nmmFlags; | ||
|
||
@JsonProperty("nm_version") |
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.
redundant
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.
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.
the annotation is redundant
i have got n m m F l a g s . where is a problem?
Sorry, I didn't get. According to the Go the field should be serialized into the nnmFlags
instead of nnm_flags
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.
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.
the point was about the case, it should be nmmFlags
instead of the nmm_flags
in the bidder request
String nmVersion; | ||
|
||
@JsonProperty("server_version") |
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.
redundant
final ObjectNode nextMillenniumNode = mapper.mapper().valueToTree( | ||
ExtRequestNextMillennium.of(nmmFlags, NM_ADAPTER_VERSION, versionProvider.getNameVersionRecord())); | ||
|
||
extRequest.addProperty("next_millennium", nextMillenniumNode); |
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.
incorrect property name, should be nextMillennium
final ObjectNode updatedImpExt = mapper.mapper().createObjectNode(); | ||
updatedImpExt.set("bidder", mapper.mapper().valueToTree(ext)); |
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.
what is this? I don't see any bidder
field in the bidder request
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.
in L11-15 there is bidder field:
"ext": {
"bidder": {
"placement_id": "placement_id"
}
}
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.
the Go doesn't have it
.build(); | ||
|
||
return bidRequest.toBuilder() | ||
.imp(bidRequest.getImp()) | ||
.ext(ExtRequest.of(updatedExt)) | ||
.imp(List.of(updatedImp)) |
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.
it should update only a first imp, but not replace the whole list of imps with a single one
updatedImpExt.set("bidder", mapper.mapper().valueToTree(ext)); | ||
|
||
final Imp updatedImp = firstImp.toBuilder() | ||
.ext(updatedImpExt) |
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.
nmmFlags should be added to the imp.ext as well
@JsonProperty("nmmFlags") | ||
List<String> nmmFlags; | ||
|
||
@JsonProperty("nmVersion") |
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.
remove annotation
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.
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.
it means the test is incorrect
this is the mapping the Go uses
type nmExtNMM struct {
NmmFlags []string `json:"nmmFlags,omitempty"`
ServerVersion string `json:"server_version,omitempty"`
AdapterVersion string `json:"nm_version,omitempty"`
}
@JsonProperty("nmVersion") | ||
String nmVersion; | ||
|
||
@JsonProperty("serverVersion") |
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.
remove annotation
🔧 Type of changes
✨ What's the context?
#3744