diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/ix/ExtImpIx.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/ix/ExtImpIx.java index e7a8faee424..f91aa6cc0fb 100644 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/ix/ExtImpIx.java +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/ix/ExtImpIx.java @@ -1,5 +1,6 @@ package org.prebid.server.proto.openrtb.ext.request.ix; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Value; @@ -11,6 +12,7 @@ public class ExtImpIx { @JsonProperty("siteId") + @JsonAlias({"siteid", "siteID"}) String siteId; List size; diff --git a/src/main/resources/static/bidder-params/ix.json b/src/main/resources/static/bidder-params/ix.json index da22db69803..f5a357c16f4 100644 --- a/src/main/resources/static/bidder-params/ix.json +++ b/src/main/resources/static/bidder-params/ix.json @@ -18,7 +18,9 @@ "description": "An array of two integer containing the dimension" } }, - "required": [ - "siteId" + "oneOf": [ + {"required": ["siteid"]}, + {"required": ["siteId"]}, + {"required": ["siteID"]} ] } diff --git a/src/test/java/org/prebid/server/bidder/ix/IxBidderTest.java b/src/test/java/org/prebid/server/bidder/ix/IxBidderTest.java index 98a7d6e006c..1c6b01e7603 100644 --- a/src/test/java/org/prebid/server/bidder/ix/IxBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/ix/IxBidderTest.java @@ -244,6 +244,37 @@ public void makeHttpRequestsShouldLimitImpsAmount() { assertThat(result.getValue()).hasSize(REQUEST_LIMIT); } + @Test + public void makeHttpRequestsShouldAcceptDifferentSiteIdAliases() { + final List imps = asList( + givenImp(impBuilder -> impBuilder + .id("123") + .ext(mapper.createObjectNode().set("bidder", + mapper.createObjectNode().put("siteid", "siteId1")))), + givenImp(impBuilder -> impBuilder + .id("346") + .ext(mapper.createObjectNode().set("bidder", + mapper.createObjectNode().put("siteId", "siteId2")))), + givenImp(impBuilder -> impBuilder + .id("678") + .ext(mapper.createObjectNode().set("bidder", + mapper.createObjectNode().put("siteID", "siteId3"))))); + final BidRequest bidRequest = givenBidRequest(requestBuilder -> + requestBuilder.imp(imps).site(Site.builder().build()), identity()); + + // when + final Result>> result = ixBidder.makeHttpRequests(bidRequest); + + // then + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()) + .extracting(HttpRequest::getPayload) + .extracting(BidRequest::getSite) + .extracting(Site::getPublisher) + .extracting(Publisher::getId) + .containsExactlyInAnyOrder("siteId1", "siteId2", "siteId3"); + } + @Test public void makeHttpRequestsShouldLimitTotalAmountOfRequests() { // given @@ -620,7 +651,7 @@ private static BidRequest givenBidRequest(Function impCustomizer) { return impCustomizer.apply(Imp.builder() .id("123") - .banner(Banner.builder().build()) + .banner(Banner.builder().w(1).h(1).build()) .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpIx.of(SITE_ID, null))))) .build(); }