Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/developers/openrtb-request-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# OpenRTB request model compatibility

The request classes in `com.iab.openrtb.request` represent OpenRTB 2.6 and retain selected legacy fields for OpenRTB 2.5 interoperability. Optional fields remain unset when absent from the input; the model does not insert specification defaults.

## OpenRTB 2.6 fields

`Video.podid` and `Audio.podid` are strings, as defined in the IAB [Video](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#objectvideo) and [Audio](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#objectaudio) tables. This preserves identifiers such as `pod-001` and numeric-looking strings with leading zeros. Numeric JSON input is accepted by the existing Jackson coercion and serialized as a string. Java callers must supply a `String` to the builders and recompile against the updated model.

The separate `/openrtb2/video` endpoint uses its own numeric pod IDs, which are not these OpenRTB impression fields.

This matches the Go models in `prebid/openrtb` used by Prebid Server: [Video](https://github.com/prebid/openrtb/blob/v20.3.0/openrtb2/video.go) and [Audio](https://github.com/prebid/openrtb/blob/v20.3.0/openrtb2/audio.go). The corresponding Video type correction was merged in [prebid/openrtb#2](https://github.com/prebid/openrtb/pull/2).

The [Content](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#objectcontent) model includes `gtax`, `genres`, `realtime`, and `firstbroadcast`. The [Data](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#objectdata) model includes `cids` for extended content identifiers. These fields survive JSON decoding and encoding in site, app, and DOOH content.

In the current 2.6 specification, `content.livestream` describes scheduled versus on-demand delivery, while `content.realtime` describes whether the event is happening in real time. Earlier definitions of `livestream` described live content. The model preserves the supplied numeric value; adapters should interpret it according to the OpenRTB version they use.

## Legacy OpenRTB 2.5 fields

The following fields were already deprecated by OpenRTB 2.5 and removed in 2.6. They are retained so that a 2.5 request does not lose them when decoded and encoded through the shared model.

| Field | Purpose in 2.5 | Replacement in 2.6 |
| --- | --- | --- |
| `banner.wmax`, `banner.hmax` | Maximum banner dimensions | `banner.format` |
| `banner.wmin`, `banner.hmin` | Minimum banner dimensions | `banner.format` |
| `video.protocol` | Single supported video protocol | `video.protocols` |
| `content.videoquality` | Video production quality | `content.prodq` |

See the [IAB specification change log](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#appendixb). Retaining these fields does not make them OpenRTB 2.6 attributes. The shared model preserves supplied values independently of their replacements; callers producing strictly 2.6 requests should use the replacements and omit the legacy fields.

`user.language` is not a standard OpenRTB request attribute and is not included in the model.
2 changes: 1 addition & 1 deletion src/main/java/com/iab/openrtb/request/Audio.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class Audio {
* within a bid request share the same podid, this indicates that
* those impression opportunities belong to the same audio ad pod.
*/
Integer podid;
String podid;

/**
* The sequence (position) of the audio ad pod within a
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/iab/openrtb/request/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@ public class Banner {
*/
Integer h;

/**
* Maximum width in device independent pixels (DIPS), retained for OpenRTB 2.5 round trips.
* Deprecated as of OpenRTB 2.5 and removed in 2.6 in favor of format.
*/
Integer wmax;

/**
* Maximum height in device independent pixels (DIPS), retained for OpenRTB 2.5 round trips.
* Deprecated as of OpenRTB 2.5 and removed in 2.6 in favor of format.
*/
Integer hmax;

/**
* Minimum width in device independent pixels (DIPS), retained for OpenRTB 2.5 round trips.
* Deprecated as of OpenRTB 2.5 and removed in 2.6 in favor of format.
*/
Integer wmin;

/**
* Minimum height in device independent pixels (DIPS), retained for OpenRTB 2.5 round trips.
* Deprecated as of OpenRTB 2.5 and removed in 2.6 in favor of format.
*/
Integer hmin;

/**
* Blocked banner ad types.
* Values:
Expand Down
28 changes: 27 additions & 1 deletion src/main/java/com/iab/openrtb/request/Content.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ public class Content {
*/
String genre;

/**
* Taxonomy used by genres. If omitted, Content Category Taxonomy 3.1 (9) is assumed.
*/
Integer gtax;

/**
* Genre IDs from the taxonomy specified by gtax.
*/
List<String> genres;

/**
* Album to which the content belongs; typically for audio.
*/
Expand Down Expand Up @@ -103,6 +113,12 @@ public class Content {
*/
Integer prodq;

/**
* Video production quality retained for OpenRTB 2.5 round trips.
* Deprecated as of OpenRTB 2.5 and removed in 2.6 in favor of prodq.
*/
Integer videoquality;

/**
* Type of content (game, video, text, etc.). Refer to <a href="https://github.com/InteractiveAdvertisingBureau/AdCOM/blob/master/AdCOM%20v1.0%20FINAL.md#list--content-contexts-">
* List: Content Contexts</a> in AdCOM 1.0.
Expand Down Expand Up @@ -136,7 +152,7 @@ public class Content {
List<String> kwarray;

/**
* 0 = not live, 1 = content is live (e.g., stream, live blog).
* Indicates whether the broadcast is scheduled: 0 = on-demand, 1 = scheduled (linear viewing).
*/
Integer livestream;

Expand Down Expand Up @@ -182,6 +198,16 @@ public class Content {
*/
Channel channel;

/**
* Indicates whether the event is happening in real time: 0 = replay, 1 = real time.
*/
Integer realtime;

/**
* Indicates whether this is the first broadcast of the content: 0 = no, 1 = yes.
*/
Integer firstbroadcast;

/**
* Placeholder for exchange-specific extensions to OpenRTB.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/iab/openrtb/request/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class Data {
*/
String name;

/**
* Extended video or audio content IDs from the source specified by name.
*/
List<String> cids;

/**
* Array of {@link Segment} (Section 3.2.22) objects that contain the actual data
* values.
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/iab/openrtb/request/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ public class Video {
*/
List<Integer> protocols;

/**
* Video protocol retained for OpenRTB 2.5 round trips.
* Deprecated as of OpenRTB 2.5 and removed in 2.6 in favor of protocols.
*/
Integer protocol;

/**
* Width of the video player in device independent pixels (DIPS).
*/
Expand All @@ -90,7 +96,7 @@ public class Video {
* within a bid request share the same podid, this indicates that
* those impression opportunities belong to the same video ad pod.
*/
Integer podid;
String podid;

/**
* The sequence (position) of the video ad pod within a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Audio {
List<Integer> protocols
Integer startdelay
List<Integer> rqddurs
Integer podid
String podid
Integer podseq
Integer sequence
Integer slotinpod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Video {
Integer width
@JsonProperty("h")
Integer height
Integer podid
String podid
Integer podseq
List<Integer> rqddurs
VideoPlacementSubtypes placement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class OrtbConverterSpec extends BaseSpec {
rqddurs = [PBSUtils.randomNumber]
maxseq = PBSUtils.randomNumber
poddur = PBSUtils.randomNumber
podid = PBSUtils.randomNumber
podid = PBSUtils.randomString
podseq = PBSUtils.randomNumber
mincpmpersec = PBSUtils.randomDecimal
slotinpod = PBSUtils.randomNumber
Expand All @@ -580,7 +580,7 @@ class OrtbConverterSpec extends BaseSpec {
rqddurs = [PBSUtils.randomNumber]
maxseq = PBSUtils.randomNumber
poddur = PBSUtils.randomNumber
podid = PBSUtils.randomNumber
podid = PBSUtils.randomString
podseq = PBSUtils.randomNumber
mincpmpersec = PBSUtils.randomDecimal
slotinpod = PBSUtils.randomNumber
Expand All @@ -604,7 +604,7 @@ class OrtbConverterSpec extends BaseSpec {
rqddurs = [PBSUtils.randomNumber]
maxseq = PBSUtils.randomNumber
poddur = PBSUtils.randomNumber
podid = PBSUtils.randomNumber
podid = PBSUtils.randomString
podseq = PBSUtils.randomNumber
mincpmpersec = PBSUtils.randomDecimal
slotinpod = PBSUtils.randomNumber
Expand All @@ -626,7 +626,7 @@ class OrtbConverterSpec extends BaseSpec {
rqddurs = [PBSUtils.randomNumber]
maxseq = PBSUtils.randomNumber
poddur = PBSUtils.randomNumber
podid = PBSUtils.randomNumber
podid = PBSUtils.randomString
podseq = PBSUtils.randomNumber
mincpmpersec = BigDecimal.valueOf(1)
slotinpod = PBSUtils.randomNumber
Expand Down
Loading