Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions topsort-api-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ components:
- $ref: "#/components/schemas/FlightsAuctionResult"
- $ref: "#/components/schemas/EmptyAuctionResult"
EmptyAuctionResult:
title: Empty Auction
description: An auction result with no winners, typically when no eligible bids are available.
type: object
properties:
Expand All @@ -1193,6 +1194,7 @@ components:
- error
- resultType
BannersAuctionResult:
title: Banner Auction
Copy link

Choose a reason for hiding this comment

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

Bug: The new BannersAuctionResult schema uses the same title: "Banner Auction" as the existing BannersAuction schema, which can cause class name collisions during client code generation.
Severity: MEDIUM

Suggested Fix

To prevent naming collisions during code generation, differentiate the titles. For example, change the title for BannersAuctionResult to "Banner Auction Result", similar to how Sponsored Listing and Sponsored Listings are used for request/result pairs elsewhere in the file.

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#L1197

Potential issue: The OpenAPI specification adds a new schema `BannersAuctionResult` with
`title: "Banner Auction"` on line 1197. This title is identical to the one used by the
pre-existing `BannersAuction` request schema. According to the project's README, clients
use this specification to generate client libraries. Duplicate schema titles can cause
class name collisions in tools like OpenAPI Generator, leading to build failures when
clients attempt to regenerate their SDKs. This prevents them from adopting the new API
changes.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jilanglois, is this a false positive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used swagger to test the solution and it looked fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also ran

bunx @redocly/cli lint topsort-api-v2.yml 
No configurations were provided -- using built in recommended configuration by default.

validating topsort-api-v2.yml...
topsort-api-v2.yml: validated in 101ms

Woohoo! Your API description is valid. 🎉

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, it looks like a fp then, but maybe we should consider the name collision part in general

description: The result of a banner auction, containing winning banner ads.
type: object
properties:
Expand All @@ -1212,6 +1214,7 @@ components:
- error
- resultType
SponsoredListingsAuctionResult:
title: Sponsored Listings
description: The result of a sponsored listings auction, containing winning product listings.
type: object
properties:
Expand Down Expand Up @@ -1303,9 +1306,11 @@ components:
$ref: "#/components/schemas/AssetSource"
minItems: 1
HotelsAuctionResult:
title: Hotels
description: The result of a hotels travel auction.
$ref: "#/components/schemas/SponsoredListingsAuctionResult"
FlightsAuctionResult:
title: Flights
description: The result of a flights travel auction, containing winning flight products.
type: object
properties:
Expand Down Expand Up @@ -1664,6 +1669,7 @@ components:
location: New York
opaqueUserId: user-123
SponsoredBrandAuctionResult:
title: Sponsored Brand
description: The result of a sponsored brand auction, containing winning brand promotions.
type: object
properties:
Expand Down
Loading