Skip to content

DSPT-4967 provide alternate method for encoding and passing ext JSON#4

Merged
kchiang6997 merged 1 commit into
amzn:mainfrom
drstevens:DSPT-4967_ext_hex_encoding
Apr 16, 2026
Merged

DSPT-4967 provide alternate method for encoding and passing ext JSON#4
kchiang6997 merged 1 commit into
amzn:mainfrom
drstevens:DSPT-4967_ext_hex_encoding

Conversation

@drstevens
Copy link
Copy Markdown
Contributor

Attempt to define an alternate method for Java implementation for passing ext and slot ext JSON without modifying original bid request content.

See README.md update

If sending via HTTP header, currently only available in Java implementation
1. retrieve protobuf generated message from Response, `Response.getExtProto`
2. Use this to generate a URI safe string using `ResponseUtil.encodedResponseMetadata`
3. Send this string as value for HTTP Header named `XAmazonTest: <encoded string>`

The goal is to avoid parsing the bid request string a second time just to insert ext JSON, only to serialize it back to bytes to send in HTTP Request body.

Unfortunately this meant making the ext JSON creation lazy and providing enough information to Response and Slot to generate both encodings.

Copy link
Copy Markdown
Collaborator

@kchiang6997 kchiang6997 left a comment

Choose a reason for hiding this comment

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

lgtm!

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.

2 participants