Skip to content

OpenRTB: Fix request model types and preserve missing fields - #4626

Open
pavel-ptashyts wants to merge 1 commit into
prebid:masterfrom
pavel-ptashyts:feature/openrtb-request-model-compatibility
Open

OpenRTB: Fix request model types and preserve missing fields#4626
pavel-ptashyts wants to merge 1 commit into
prebid:masterfrom
pavel-ptashyts:feature/openrtb-request-model-compatibility

Conversation

@pavel-ptashyts

Copy link
Copy Markdown
Contributor

Type of changes

  • bugfix
  • documentation

What's the context?

The shared request model rejects alphanumeric OpenRTB 2.6 pod IDs and drops several content fields during JSON round trips. For example, video.podid: "pod-001" cannot be decoded as an Integer, and content.genres and content.data[].cids disappear from the serialized request.

Change Video.podid and Audio.podid to String. Add Content.gtax, genres, realtime, firstbroadcast, and Data.cids. Update the livestream documentation to distinguish scheduled broadcasts from real-time events, and explain the version-dependent interpretation.

Also retain the legacy OpenRTB 2.5 fields Banner.wmax/hmax/wmin/hmin, Video.protocol, and Content.videoquality so a 2.5 request can pass through the model without losing them. Their JavaDoc and the compatibility documentation explain that they were removed in 2.6 in favor of format, protocols, and prodq. Values remain independent; the model does not perform implicit conversion between legacy fields and their replacements.

Rationale behind the change

Numeric JSON pod IDs are still accepted through existing Jackson coercion and are serialized as strings. Java consumers must update Integer pod ID builder arguments/getter usages to String and recompile. The separate video endpoint's numeric pod IDs are unchanged.

Test plan

Regression tests cover alphanumeric and numeric pod IDs, leading zeros, preservation of content fields in site/app/DOOH, zero-valued flags, empty arrays, omitted optional fields, and the legacy 2.5 fields alongside their replacements. Existing Groovy converter fixtures now use string pod IDs.

mvn test on JDK 25: 8,794 tests, 3 failures, 0 errors, 2 skipped. All 14 new regression tests pass, as do the OpenRTB version-converter tests. Checkstyle reports no violations.

The three failures are existing UidsCookieServiceTest cookie-size/order expectations: updateUidsCookieShouldNotFitPrioritizedFamilyWhenSizeExceedsLimitAndIncrementMetric, updateUidsCookieShouldFitPrioritizedFamily, and updateUidsCookieShouldFitNonPrioritizedFamily. All three were reproduced by running mvn test -Dtest=UidsCookieServiceTest -Dmaven.gitcommitid.skip=true in a clean archive of unchanged baseline commit eed9a61046072694d4b42b5aec7a852ceed3a188.

After the final documentation/test cleanup, the focused run passed all 30 tests: mvn test -Dtest=OpenRtbRequestModelTest,BidRequestOrtb25To26ConverterTest,BidRequestOrtb26To25ConverterTest. Checkstyle also passed.

Groovy functional tests compile as part of the build; the Docker-based functional suite was not run.

Quality check

  • Follow project code style guidelines.
  • Breaking Java model API change is documented above.
  • Coverage exceeds 90%: the existing JaCoCo configuration excludes com/iab/openrtb/**; these DTOs have behavioral regression tests, but no coverage percentage is claimed.
  • No debug logging or temporary code added.

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.

1 participant