Skip to content

Conversation

@przemkaczmarek
Copy link
Collaborator

…rough with the correct custom parameters.

🔧 Type of changes

  • bid adapter update

✨ What's the context?

#4220

"USD"
],
"source" :
{"tid" : "${json-unit.any-string}"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

please format

Comment on lines 84 to 91
final Map<String, Object> extMap = mapper.mapper().convertValue(imp.getExt(), new TypeReference<>() {
});
final Map<String, Object> bidderMap = (Map<String, Object>) extMap.remove("bidder");
if (bidderMap != null) {
extMap.putAll(bidderMap);
}
final ObjectNode newExt = mapper.mapper().valueToTree(extMap);
return imp.toBuilder().ext(newExt).build();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd probably use the following approach:

        final ObjectNode impExt = imp.getExt().deepCopy();
        final JsonNode bidderNode = impExt.remove("bidder");
        bidderNode.fields().forEachRemaining(field -> impExt.set(field.getKey(), field.getValue()));
        return imp.toBuilder().ext(impExt).build();

Comment on lines 84 to 91
final Map<String, Object> extMap = mapper.mapper().convertValue(imp.getExt(), new TypeReference<>() {
});
final Map<String, Object> bidderMap = (Map<String, Object>) extMap.remove("bidder");
if (bidderMap != null) {
extMap.putAll(bidderMap);
}
final ObjectNode newExt = mapper.mapper().valueToTree(extMap);
return imp.toBuilder().ext(newExt).build();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also please cover the changes with the unit test (the existing fields like gpid should be preserved - an additional case)

@CTMBNara CTMBNara merged commit 9e66886 into master Oct 27, 2025
7 of 9 checks passed
@CTMBNara CTMBNara deleted the CPMStar-imp.ext-passthrough branch October 27, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port PR from PBS-Go: CPMStar: imp.ext passthrough

4 participants