forked from prebid/prebid-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added adapter param schemas & endpoint (prebid#147)
* Added schema files for a few users, and an endpoint which serves them. * Added some comments. * Added tests, and named the function more generally. * Removed t.Helper(), which doesnt exist in Go 1.8 * Made the facebook placementId required. * Added schemas for all the other bidders. * Modified the tests so that they force all adapters to have uploaded a schema. * Added documentation. * Added the two new params to the rubicon schema. * Moved .md file so that the file path parallels the URL
- Loading branch information
Showing
10 changed files
with
287 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## GET /bidders/params | ||
|
||
This endpoint gets informatoin about all the custom bidders params that Prebid Server supports. | ||
|
||
### Returns | ||
|
||
A JSON object whose keys are bidder codes, and values are Draft 4 JSON schemas which describe that bidders' params. | ||
|
||
For example: | ||
|
||
``` | ||
{ | ||
"appnexus": { /* A json-schema describing AppNexus' bidder params */ }, | ||
"rubicon": { /* A json-schema describing Rubicon's bidder params */ } | ||
... all other bidders will have similar keys & values here ... | ||
} | ||
``` | ||
|
||
The exact contents of the json-schema values can be found [here](../../../static/bidder-params). | ||
|
||
### See also | ||
|
||
- [JSON schema homepage](http://json-schema.org/specification-links.html#draft-4) | ||
- [Understanding JSON schema](https://spacetelescope.github.io/understanding-json-schema/) |
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
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,65 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Appnexus Adapter Params", | ||
"description": "A schema which validates params accepted by the AppNexus adapter", | ||
|
||
"type": "object", | ||
"properties": { | ||
"placementId": { | ||
"type": "integer", | ||
"description": "An ID which identifies this placement of the impression" | ||
}, | ||
"invCode": { | ||
"type": "string", | ||
"description": "A code identifying the inventory of this placement." | ||
}, | ||
"member": { | ||
"type": "string", | ||
"description": "An ID which identifies the member selling the impression." | ||
}, | ||
"keywords": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"type": "object", | ||
"description": "A key with one or more values associated with it. These are used in buy-side segment targeting.", | ||
"properties": { | ||
"key": { | ||
"type": "string" | ||
}, | ||
"value": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["key", "value"] | ||
} | ||
}, | ||
"trafficSourceCode": { | ||
"type": "string", | ||
"description": "Specifies the third-party source of this impression." | ||
}, | ||
"reserve": { | ||
"type": "number", | ||
"description": "The minimium acceptable bid, in CPM, using US Dollars" | ||
}, | ||
"position": { | ||
"type": "string", | ||
"enum": ["above", "below"], | ||
"description": "Specifies the ad unit as above or below the fold" | ||
} | ||
}, | ||
|
||
"oneOf": [{ | ||
"required": ["placementId"] | ||
}, { | ||
"required": ["invCode", "member"] | ||
}], | ||
|
||
"not": { | ||
"required": ["placementId", "invCode", "member"] | ||
} | ||
} |
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,13 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Facebook Adapter Params", | ||
"description": "A schema which validates params accepted by the Facebook adapter", | ||
"type": "object", | ||
"properties": { | ||
"placementId": { | ||
"type": "string", | ||
"description": "An ID which identifies the placement selling the impression" | ||
} | ||
}, | ||
"required": ["placementId"] | ||
} |
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,13 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Index Adapter Params", | ||
"description": "A schema which validates params accepted by the Index adapter", | ||
"type": "object", | ||
"properties": { | ||
"siteID": { | ||
"type": "integer", | ||
"description": "An ID which identifies the site selling the impression" | ||
} | ||
}, | ||
"required": ["siteID"] | ||
} |
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,13 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Lifestreet Adapter Params", | ||
"description": "A schema which validates params accepted by the Lifestreet adapter", | ||
"type": "object", | ||
"properties": { | ||
"slot_tag": { | ||
"type": "string", | ||
"description": "A tag which identifies the ad slot" | ||
} | ||
}, | ||
"required": ["slot_tag"] | ||
} |
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,17 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Pubmatic Adapter Params", | ||
"description": "A schema which validates params accepted by the Pubmatic adapter", | ||
"type": "object", | ||
"properties": { | ||
"publisherId": { | ||
"type": "string", | ||
"description": "An ID which identifies the publisher" | ||
}, | ||
"adSlot": { | ||
"type": "string", | ||
"description": "An ID which identifies the ad slot" | ||
} | ||
}, | ||
"required": ["publisherId", "adSlot"] | ||
} |
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,22 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Pulsepoint Adapter Params", | ||
"description": "A schema which validates params accepted by the Pulsepoint adapter", | ||
"type": "object", | ||
"properties": { | ||
"cp": { | ||
"type": "integer", | ||
"description": "An ID which identifies the publisher selling the impression" | ||
}, | ||
"ct": { | ||
"type": "integer", | ||
"description": "An ID which identifies the ad slot being sold" | ||
}, | ||
"cf": { | ||
"type": "string", | ||
"pattern": "^[0-9]+x[0-9]+$", | ||
"description": "The size of the ad slot being sold. This should be a string like 300x250" | ||
} | ||
}, | ||
"required": ["cp", "ct", "cf"] | ||
} |
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,35 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "Rubicon Adapter Params", | ||
"description": "A schema which validates params accepted by the Rubicon adapter", | ||
"type": "object", | ||
"properties": { | ||
"accountId": { | ||
"type": "integer", | ||
"description": "An ID which identifies the publisher's account" | ||
}, | ||
"siteId": { | ||
"type": "integer", | ||
"description": "An ID which identifies the site selling the impression" | ||
}, | ||
"zoneId": { | ||
"type": "integer", | ||
"description": "An ID which identifies the sub-section of the site where the impression is located" | ||
}, | ||
"inventory": { | ||
"type": "object", | ||
"description": "An object defining arbitrary targeting key/value pairs related to the page", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
}, | ||
"visitor": { | ||
"type": "object", | ||
"description": "An object defining arbitrary targeting key/value pairs related to the visitor", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["accountId", "siteId", "zoneId"] | ||
} |