Skip to content

feat: add external demand to sponsored listings auction#199

Merged
jilanglois merged 4 commits intomainfrom
feat/jjl/add-external-demand
Mar 3, 2026
Merged

feat: add external demand to sponsored listings auction#199
jilanglois merged 4 commits intomainfrom
feat/jjl/add-external-demand

Conversation

@jilanglois
Copy link
Contributor

@jilanglois jilanglois commented Feb 27, 2026

Added external demand fields to auction request and new option for sponsored listings winners with external demand.
Doc: Demand Mediation API

The demandSources request field is added to the sponsored listings request object. The response for sponsored listings with external demand is a new object/option: the schema is a bit different so I think it is better for it to be a stand alone object/option
Captura de pantalla 2026-02-27 a la(s) 5 36 48 p  m

Bonus: Fix indentation for examples to show up.

@jilanglois jilanglois requested a review from a team as a code owner February 27, 2026 20:26
@jilanglois jilanglois requested review from celzo and eosorted February 27, 2026 20:32
Copy link

@jconnolly200 jconnolly200 left a comment

Choose a reason for hiding this comment

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

Looks good assuming it renders properly

@jilanglois jilanglois merged commit 3150c59 into main Mar 3, 2026
6 checks passed
@jilanglois jilanglois deleted the feat/jjl/add-external-demand branch March 3, 2026 19:41
Comment on lines +1427 to +1431
$ref: "#/components/schemas/WinnerRank"
type:
$ref: "#/components/schemas/WinnerType"
enum:
- product
Copy link

Choose a reason for hiding this comment

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

Bug: The ExternalDemandSponsoredListingsWinner schema incorrectly restricts the type field to product, preventing non-product Topsort winners (e.g., vendor, brand) from being returned in external demand auctions.
Severity: MEDIUM

Suggested Fix

Modify the type property within the ExternalDemandSponsoredListingsWinner schema to allow all valid winner types: ['product', 'vendor', 'brand', 'url']. This aligns it with the SponsoredListingsWinner schema and correctly reflects that Topsort-sourced winners in an external demand auction can be of any type, not just product.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: topsort-api-v2.yml#L1427-L1431

Potential issue: The `ExternalDemandSponsoredListingsWinner` schema restricts the `type`
field to an enum containing only `'product'`. However, in an external demand auction,
internal Topsort campaigns can compete, and these campaigns can be of type `'product'`,
`'vendor'`, `'brand'`, or `'url'`. While external demand sources are limited to product
bids, a Topsort campaign of a non-product type could still win the auction. If a
`'vendor'` or `'brand'` campaign wins, the API response would contain a `type` value
that violates the schema, potentially causing validation failures in client
applications.

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.

3 participants