Skip to content

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

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

pavel-ptashyts wants to merge 4 commits into
prebid:masterfrom
pavel-ptashyts:feature/openrtb-request-model-compatibility

Conversation

@pavel-ptashyts

@pavel-ptashyts pavel-ptashyts commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Type of changes

  • bugfix

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 JavaDoc to distinguish scheduled broadcasts from real-time events.

Rationale behind the change

Deprecated OpenRTB 2.5 fields (banner.wmax/hmax/wmin/hmin, video.protocol, and content.videoquality) remain unsupported, consistent with the existing PBS-Java/PBS-Go behavior. They are ignored during JSON decoding and are not preserved by the shared model or protobuf mapper.

  • IAB OpenRTB 2.6 specifies string pod IDs for both Video and Audio.

  • The Go implementation made the same Video correction in prebid/openrtb#2. Both Video and Audio use string PodID.

  • The content attributes are defined in the IAB Content and Data tables.

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.

The 2.5/2.6 converters were checked: these fields introduce no new ext-to-root relocation. Their existing behavior of retaining newer content and media fields for older adapters is preserved.

Test plan

  • Focused run on JDK 25: 52 tests passed in ProtobufRequestUtilsTest, both request version-converter test classes and BidRequestOrtbVersionConverterFactoryTest. Checkstyle passed; production, Java test and Groovy functional test sources compiled.

  • Existing functional pod-ID cases use strings. New OrtbConverterSpec scenarios cover content metadata and data.cids in site/app/DOOH for 2.5 and 2.6 adapters, using randomized metadata and typed broadcast flags, with separate tests for each adapter version and checks for response errors and warnings. These scenarios compile. A standalone check using the functional JSON mapper passed serialization and deserialization for all four broadcast flag combinations, including zero values and the firstbroadcast wire name. A local Docker run using the rebuilt server image was attempted but stopped during global Testcontainers setup: the JVM waited in CopyArchiveToContainerCmd while copying files into MySQL, before any scenarios ran. No functional pass is claimed.

The generic DTO round-trip test class and separate compatibility document were removed following review.

Quality check

  • Follow project code style guidelines.

  • Breaking Java model API change is documented above.

  • No debug logging or temporary code added.

The existing JaCoCo configuration excludes com/iab/openrtb/**; no DTO coverage percentage is claimed.

@CTMBNara CTMBNara left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check whether you need to add any logic to BidRequestOrtbVersionConverter.
Also, update ProtobufRequestUtils if needed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed OpenRtbRequestModelTest as requested. The protobuf mapping changes are covered in the existing ProtobufRequestUtilsTest, and content preservation scenarios were added to the existing OrtbConverterSpec.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this file. The field/version explanations remain in the model JavaDoc and PR description.

@pavel-ptashyts

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I updated ProtobufRequestUtils to map banner.wmax/hmax/wmin/hmin, video.protocol and content.videoquality to their existing protobuf fields. The existing mapper fixtures now cover these values alongside their replacements, with additional checks that missing legacy values stay unset.

I also checked both BidRequestOrtbVersionConverter implementations. These additions do not introduce an ext-to-root relocation, so no conversion logic was added. The existing behavior of retaining newer content/media fields for 2.5 adapters is preserved. The bundled protobuf schema does not define the other 2.6 fields in this PR, so I have not added arbitrary protobuf tags or extension mappings for them.

The requested document and generic DTO test class are removed. I added scenarios to OrtbConverterSpec for gtax, genres, realtime, firstbroadcast and data.cids across site/app/DOOH and both adapter versions, including zero flags and leading-zero identifiers.

Validation: all 55 focused protobuf/version-converter Java tests pass, Checkstyle passes, and the Groovy scenarios compile. I attempted the new scenarios with a rebuilt server Docker image, but the local run stalled during global Testcontainers setup while copying files into MySQL, before any scenarios executed; I stopped that run rather than reporting it as passed.

CTMBNara
CTMBNara previously approved these changes Sep 17, 2026
@Net-burst

Copy link
Copy Markdown
Collaborator

Hello, @pavel-ptashyts . Thanks for your contribution. There is a caveat: we made a conscious decision not to support those deprecated OpenRTB 2.5 fields. This is aligned between PBS-Java and PBS-Go. Could you please remove them from the PR? Thanks in advance.

@pavel-ptashyts

Copy link
Copy Markdown
Contributor Author

Thanks for clarifying, @Net-burst. I removed all six deprecated fields (banner.wmax/hmax/wmin/hmin, video.protocol, and content.videoquality), including their protobuf mappings and related tests.

The PR now keeps only the OpenRTB 2.6 changes: string pod IDs for audio/video, the missing content/data fields, and the corrected livestream documentation. The functional scenarios covering those fields remain in place.

Validation: all 52 focused protobuf and version-converter tests pass, as does Checkstyle. Production sources and Java/Groovy test sources compile. The new functional scenarios have not been verified at runtime because the previous local run stalled during Testcontainers setup.

@pavel-ptashyts

Copy link
Copy Markdown
Contributor Author

Hi @Net-burst could you review PR now.
Thank in advance

Comment thread src/test/groovy/org/prebid/server/functional/model/request/auction/Content.groovy Outdated
Comment thread src/test/groovy/org/prebid/server/functional/tests/OrtbConverterSpec.groovy Outdated
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.

4 participants