-
Notifications
You must be signed in to change notification settings - Fork 224
CpmStar: Adapter Update bidder implementation to allow imp.ext passth… #4228
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
Conversation
…rough with the correct custom parameters.
| "USD" | ||
| ], | ||
| "source" : | ||
| {"tid" : "${json-unit.any-string}"}, |
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.
please format
| 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(); |
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.
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();| 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(); |
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.
Also please cover the changes with the unit test (the existing fields like gpid should be preserved - an additional case)
…rough with the correct custom parameters.
🔧 Type of changes
✨ What's the context?
#4220