From 8ca2235b841ef6fa50928a82aed0cc717a09721e Mon Sep 17 00:00:00 2001 From: Hadar Cohen Date: Wed, 15 Apr 2026 16:33:36 +0300 Subject: [PATCH] Change Native.RequestObject from string to json.RawMessage - Updates RequestObject field type to support unescaped JSON object serialization - Adds comprehensive documentation explaining the dual-field pattern - Enables simultaneous sending of request (string) and requestobj (object) --- openrtb2/native.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/openrtb2/native.go b/openrtb2/native.go index d1867f0..ed56f11 100644 --- a/openrtb2/native.go +++ b/openrtb2/native.go @@ -41,8 +41,19 @@ type Native struct { // Markup Request Object, section 4.1 of OpenRTB Native 1.1+. Request string `json:"request,omitempty"` - // this is the native request object for Magnite on native version 1.0. - RequestObject string `json:"requestobj,omitempty"` + // Attribute: + // requestobj + // Type: + // object + // Description: + // Native request as a JSON object (not escaped string). + // Used by some exchanges (e.g., Magnite) to support both + // request (escaped string) and requestobj (unescaped object) + // simultaneously. This allows DSPs to parse the native request + // without double-decoding the JSON string. + // When populated, this should contain the marshaled native + // request object that corresponds to the "request" field. + RequestObject json.RawMessage `json:"requestobj,omitempty"` // Attribute: // ver