-
Notifications
You must be signed in to change notification settings - Fork 246
NextMillennium: Adapter and server version #3814
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
Changes from 1 commit
333befd
99a129e
34fad7e
961a9c8
40fdf2f
9b6a05e
249843e
97ab21e
8e6da2f
fa02a9c
95c2a5c
4ac1dc4
2225a20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| import org.prebid.server.proto.openrtb.ext.ExtPrebid; | ||
| import org.prebid.server.proto.openrtb.ext.request.ExtRequest; | ||
| import org.prebid.server.proto.openrtb.ext.request.ExtRequestPrebid; | ||
| import org.prebid.server.proto.openrtb.ext.request.ExtRequestPrebidServer; | ||
| import org.prebid.server.proto.openrtb.ext.request.ExtStoredRequest; | ||
| import org.prebid.server.proto.openrtb.ext.request.nextmillennium.ExtImpNextMillennium; | ||
| import org.prebid.server.proto.openrtb.ext.request.nextmillennium.ExtRequestNextMillennium; | ||
|
|
@@ -40,7 +41,6 @@ | |
| import java.util.Collection; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
| import java.util.Optional; | ||
|
|
||
| public class NextMillenniumBidder implements Bidder<BidRequest> { | ||
|
|
||
|
|
@@ -95,26 +95,33 @@ private ExtImpNextMillennium convertExt(ObjectNode impExt) { | |
| private BidRequest updateBidRequest(BidRequest bidRequest, ExtImpNextMillennium ext) { | ||
| final ExtStoredRequest storedRequest = ExtStoredRequest.of(resolveStoredRequestId(bidRequest, ext)); | ||
|
|
||
| final ExtRequest requestExt = bidRequest.getExt(); | ||
| final ExtRequestPrebid existingPrebid = requestExt != null ? requestExt.getPrebid() : null; | ||
| final ExtRequestPrebidServer existingServer = existingPrebid != null ? existingPrebid.getServer() : null; | ||
|
|
||
| final ExtRequestPrebid createdExtRequestPrebid = ExtRequestPrebid.builder() | ||
| .storedrequest(storedRequest) | ||
| .server(existingServer) | ||
| .build(); | ||
|
|
||
| final ExtRequestPrebid extRequestPrebid = Optional.ofNullable(bidRequest) | ||
| .map(BidRequest::getExt) | ||
| .map(ExtRequest::getPrebid) | ||
| .map(prebid -> prebid.toBuilder().storedrequest(storedRequest).build()) | ||
| .orElse(createdExtRequestPrebid); | ||
|
|
||
| final ExtRequestPrebid updatedExt = extRequestPrebid.toBuilder() | ||
| .nextMillennium(ExtRequestNextMillennium.of( | ||
| nmmFlags, | ||
| NM_ADAPTER_VERSION, | ||
| versionProvider.getNameVersionRecord())) | ||
| final ExtRequest extRequest = ExtRequest.of(createdExtRequestPrebid); | ||
|
|
||
| final ObjectNode nextMillenniumNode = mapper.mapper().valueToTree( | ||
| ExtRequestNextMillennium.of(nmmFlags, NM_ADAPTER_VERSION, versionProvider.getNameVersionRecord())); | ||
|
|
||
| extRequest.addProperty("next_millennium", nextMillenniumNode); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. incorrect property name, should be |
||
|
|
||
| final Imp firstImp = bidRequest.getImp().getFirst(); | ||
| final ObjectNode updatedImpExt = mapper.mapper().createObjectNode(); | ||
| updatedImpExt.set("bidder", mapper.mapper().valueToTree(ext)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this? I don't see any
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in L11-15 there is bidder field:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the Go doesn't have it |
||
|
|
||
| final Imp updatedImp = firstImp.toBuilder() | ||
| .ext(updatedImpExt) | ||
|
przemkaczmarek marked this conversation as resolved.
Outdated
|
||
| .build(); | ||
|
|
||
| return bidRequest.toBuilder() | ||
| .imp(bidRequest.getImp()) | ||
| .ext(ExtRequest.of(updatedExt)) | ||
| .imp(List.of(updatedImp)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| .ext(extRequest) | ||
| .build(); | ||
|
Comment on lines
+115
to
+113
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
|
|
||
|
CTMBNara marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,19 @@ | ||
| package org.prebid.server.proto.openrtb.ext.request.nextmillennium; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import lombok.Value; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Value(staticConstructor = "of") | ||
| public class ExtRequestNextMillennium { | ||
|
|
||
| @JsonProperty("nmm_flags") | ||
| List<String> nmmFlags; | ||
|
CTMBNara marked this conversation as resolved.
Outdated
|
||
|
|
||
| @JsonProperty("nm_version") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the annotation is redundant
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the point was about the case, it should be |
||
| String nmVersion; | ||
|
|
||
| @JsonProperty("server_version") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant |
||
| String serverVersion; | ||
| } | ||


Uh oh!
There was an error while loading. Please reload this page.