-
Notifications
You must be signed in to change notification settings - Fork 739
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
PulsePoint: Marking cp/ct params to be either String or Int #3677
Merged
gargcreation1992
merged 7 commits into
prebid:master
from
pulsepointinc:PulsePoint-ParamsUpdate
Jul 1, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3730923
Marking cp/ct params to be either String or Int
anand-venkatraman 929b96b
fixing test
anand-venkatraman e732c3f
adding tests for valid string parameters for ct/cp
anand-venkatraman 4539af1
Adding json framework tests and some fixes
anand-venkatraman 394b0da
addressing review comment to use StringInt
anand-venkatraman 0a2a52c
running gofmt
anand-venkatraman f4c20f4
minor refactor
anand-venkatraman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
adapters/pulsepoint/pulsepointtest/exemplary/banner-string-bidder-params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "request-id", | ||
"site": { | ||
"page": "http://publisher.com/index.html", | ||
"publisher": { | ||
"id": "123456789", | ||
"name": "publisher.com" | ||
} | ||
}, | ||
"imp": [{ | ||
"id": "banner-1", | ||
"banner": { | ||
"w": 320, | ||
"h": 50 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"cp": "1234", | ||
"ct": "1001" | ||
} | ||
} | ||
}] | ||
}, | ||
"httpCalls": [{ | ||
"expectedRequest": { | ||
"headers": { | ||
"Content-Type": [ | ||
"application/json;charset=utf-8" | ||
], | ||
"Accept": [ | ||
"application/json" | ||
] | ||
}, | ||
"uri": "http://bidder.pulsepoint.com", | ||
"body": { | ||
"id": "request-id", | ||
"site": { | ||
"page": "http://publisher.com/index.html", | ||
"publisher": { | ||
"id": "1234", | ||
"name": "publisher.com" | ||
} | ||
}, | ||
"imp": [{ | ||
"id": "banner-1", | ||
"tagid": "1001", | ||
"banner": { | ||
"w": 320, | ||
"h": 50 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"cp": "1234", | ||
"ct": "1001" | ||
} | ||
} | ||
}] | ||
}, | ||
"impIDs":["banner-1"] | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "response-id", | ||
"seatbid": [{ | ||
"bid": [{ | ||
"id": "banner-1-bid", | ||
"impid": "banner-1", | ||
"price": 3.5, | ||
"adm": "<div>Creative</div>", | ||
"adomain": [ | ||
"advertiser.com" | ||
], | ||
"crid": "20", | ||
"w": 300, | ||
"h": 250 | ||
}], | ||
"seat": "pulsepoint-seat" | ||
}], | ||
"cur": "USD" | ||
} | ||
} | ||
}], | ||
"expectedBidResponses": [{ | ||
"bids": [{ | ||
"bid": { | ||
"id": "banner-1-bid", | ||
"impid": "banner-1", | ||
"price": 3.5, | ||
"adm": "<div>Creative</div>", | ||
"adomain": [ | ||
"advertiser.com" | ||
], | ||
"crid": "20", | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
"type": "banner" | ||
}] | ||
}] | ||
} |
31 changes: 31 additions & 0 deletions
31
adapters/pulsepoint/pulsepointtest/supplemental/bad-prebid-params-missing-param.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "request-id", | ||
"site": { | ||
"page": "http://publisher.com/index.html", | ||
"publisher": { | ||
"id": "123456789", | ||
"name": "publisher.com" | ||
} | ||
}, | ||
"imp": [{ | ||
"id": "banner-1", | ||
"banner": { | ||
"w": 320, | ||
"h": 50 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"cp": "1234" | ||
} | ||
} | ||
}] | ||
}, | ||
"httpCalls": [], | ||
"expectedMakeRequestsErrors": [{ | ||
"value": "param not found - tagID", | ||
"comparison": "literal" | ||
}], | ||
"expectedBidResponses": [], | ||
"expectedMakeBidsErrors": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package openrtb_ext | ||
|
||
import ( | ||
"github.com/prebid/prebid-server/v2/util/jsonutil" | ||
) | ||
|
||
// ExtImpPulsePoint defines the json spec for bidrequest.imp[i].ext.prebid.bidder.pulsepoint | ||
// PubId/TagId are mandatory params | ||
|
||
type ExtImpPulsePoint struct { | ||
PubID int `json:"cp"` | ||
TagID int `json:"ct"` | ||
PubID jsonutil.StringInt `json:"cp"` | ||
TagID jsonutil.StringInt `json:"ct"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@anand-venkatraman could you add JSON test where
cp
andct
are stringThere 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.
@anand-venkatraman requesting to address above comment ^^
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.
sorry for the delay, i have added a few tests cases to
validParams
underparams_test.go
file.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.
@anand-venkatraman thanks for adding
params
test. Requesting to add Json framework tests as well for scenario wherecp
andct
are string in imp.extThere 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.
addressed in commit 4539af1