Skip to content
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

Extend PG Targeting to match single String or Integer value #1653

Merged

Conversation

rpanchyk
Copy link
Contributor

@rpanchyk rpanchyk commented Dec 24, 2021

Changed targeting matching for: bidp., ufpd., sfpd.

Before, this request only matched:

"user": {
  "ext": {
    "data": {
      "segment": [ "ww20k1cw8" ]
    }
  }
}

Now, the request like:

"user": {
  "ext": {
    "data": {
      "segment": "ww20k1cw8"
    }
  }
}

will be matched for:

"ufpd.segment": {  "$intersects": [ "ww20k1cw8" ] }

@@ -269,6 +284,18 @@ private static Integer nodeToInteger(JsonNode node) {
return node.isInt() ? node.asInt() : null;
}

private static <T> List<T> nodeToListOfStrings(JsonNode node, Function<JsonNode, T> valueExtractor) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not private static List<String> nodeToListOfStrings(JsonNode node, Function<JsonNode, String> valueExtractor), I mean why do we use generic return type, when method name implies that return type should be List<String>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.

rpanchyk added 2 commits January 13, 2022 13:28
…-and-integer

# Conflicts:
#	src/main/java/org/prebid/server/deals/targeting/RequestContext.java
#	src/test/java/org/prebid/server/deals/targeting/RequestContextTest.java
@rpanchyk rpanchyk merged commit dfc620b into master Jan 14, 2022
@rpanchyk rpanchyk deleted the deals/extend-targeting-matching-for-string-and-integer branch January 14, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants