Skip to content
Comment thread
CTMBNara marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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> {

Expand Down Expand Up @@ -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);

Copy link
Copy Markdown
Contributor

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 Imp firstImp = bidRequest.getImp().getFirst();
final ObjectNode updatedImpExt = mapper.mapper().createObjectNode();
updatedImpExt.set("bidder", mapper.mapper().valueToTree(ext));

Copy link
Copy Markdown
Contributor

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

@przemkaczmarek przemkaczmarek Mar 10, 2025

Copy link
Copy Markdown
Collaborator Author

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"
        }
      }

Copy link
Copy Markdown
Contributor

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


final Imp updatedImp = firstImp.toBuilder()
.ext(updatedImpExt)
Comment thread
przemkaczmarek marked this conversation as resolved.
Outdated
.build();

return bidRequest.toBuilder()
.imp(bidRequest.getImp())
.ext(ExtRequest.of(updatedExt))
.imp(List.of(updatedImp))

Copy link
Copy Markdown
Contributor

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

.ext(extRequest)
.build();
Comment on lines +115 to +113

Copy link
Copy Markdown
Contributor

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

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.prebid.server.auction.model.PaaFormat;
import org.prebid.server.floors.model.PriceFloorRules;
import org.prebid.server.json.deserializer.IntegerFlagDeserializer;
import org.prebid.server.proto.openrtb.ext.request.nextmillennium.ExtRequestNextMillennium;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -191,9 +190,4 @@ public class ExtRequestPrebid {
*/
@JsonProperty("paaformat")
PaaFormat paaFormat;

/**
* Defines the contract for bidrequest.ext.prebid.nextMillennium
*/
ExtRequestNextMillennium nextMillennium;
}
Comment thread
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;
Comment thread
CTMBNara marked this conversation as resolved.
Outdated

@JsonProperty("nm_version")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

redundant

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think its not redutat because i got from server:
image

and how about "still incorrect, it should be nmmFlags" i have got n m m F l a g s . where is a problem?

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

nnm or nmm ? I have got nmm in Go and Java
image

@AntoxaAntoxic AntoxaAntoxic Mar 11, 2025

Copy link
Copy Markdown
Contributor

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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

redundant

String serverVersion;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"secure": 1,
"ext": {
"tid": "${json-unit.any-string}",
"bidder": {
"placement_id": "placement_id"
}
Expand Down Expand Up @@ -53,12 +52,12 @@
"gvlid": 1,
"datacenter": "local",
"endpoint": "/openrtb2/auction"
},
"next_millennium": {
"nmm_flags": [ "1" ],
"nm_version": "v1.0.0",
"server_version": "${json-unit.any-string}"
}
},
"next_millennium": {
"nmm_flags": [ "1" ],
"nm_version": "v1.0.0",
"server_version": "${json-unit.any-string}"
}
}
}