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.
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.
imp[0].ext update is missing
| /** | ||
| * Defines the contract for bidrequest.ext.prebid.nextMillennium | ||
| */ | ||
| ExtRequestNextMillennium nextMillennium; |
There was a problem hiding this comment.
deserialization is incorrect here
| @JsonProperty("nmm_flags") | ||
| List<String> nmmFlags; | ||
|
|
||
| @JsonProperty("nm_version") |
There was a problem hiding this comment.
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.
the point was about the case, it should be nmmFlags instead of the nmm_flags in the bidder request
| @JsonProperty("nm_version") | ||
| String nmVersion; | ||
|
|
||
| @JsonProperty("server_version") |
| 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.
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.
what is this? I don't see any bidder field in the bidder request
There was a problem hiding this comment.
in L11-15 there is bidder field:
"ext": {
"bidder": {
"placement_id": "placement_id"
}
}
There was a problem hiding this comment.
the Go doesn't have it
| return bidRequest.toBuilder() | ||
| .imp(bidRequest.getImp()) | ||
| .ext(ExtRequest.of(updatedExt)) | ||
| .imp(List.of(updatedImp)) |
There was a problem hiding this comment.
it should update only a first imp, but not replace the whole list of imps with a single one
| @JsonProperty("nmmFlags") | ||
| List<String> nmmFlags; | ||
|
|
||
| @JsonProperty("nmVersion") |
There was a problem hiding this comment.
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") |
| final Imp firstImp = bidRequest.getImp().getFirst(); | ||
| final ObjectNode updatedImpExt = mapper.mapper().createObjectNode(); | ||
| updatedImpExt.set("bidder", mapper.mapper().valueToTree(ext)); | ||
| updatedImpExt.set("nextMillennium", nextMillenniumNode); |
There was a problem hiding this comment.
the nextMillenniumNode should have only nmmFlags if it's an imp.ext
| final Imp firstImp = bidRequest.getImp().getFirst(); | ||
| final ObjectNode updatedImpExt = mapper.mapper().createObjectNode(); | ||
| updatedImpExt.set("nextMillennium", nextMillenniumNode); | ||
| updatedImpExt.set("nextMillennium", nextMillenniumNode.get("nmmFlags")); |
There was a problem hiding this comment.
this is incorrect, please observe the Go code one more time
| } | ||
|
|
||
| private BidRequest updateBidRequest(BidRequest bidRequest, ExtImpNextMillennium ext) { | ||
| private BidRequest updateBidRequest1(BidRequest bidRequest, ExtImpNextMillennium ext) { |
…3744 # Conflicts: # src/main/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidder.java



🔧 Type of changes
✨ What's the context?
#3744