New v2 API models (no usage yet)#2349
Conversation
Signed-off-by: GelatoGenesis <tarmokalling@gmail.com>
📝 WalkthroughWalkthroughOpenAPI specification adds a comprehensive V2 API surface spanning drops, notifications, and waves domains. Includes 15+ new versioned endpoints with corresponding schemas, plus a minor constraint update allowing larger page sizes for an existing endpoint. ChangesV2 API Surface (Drops, Notifications, Waves)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
openapi.yaml (1)
9795-9808:⚠️ Potential issue | 🟠 Major | ⚡ Quick winKeep the V2 resolved-profile fields nullable.
The V1 contract allows metadata rows without a resolved profile and resolved profiles without a bio. Tightening both fields here will generate client types that reject existing payloads.
Proposed fix
ApiDropMetadataV2: type: object required: - data_key - data_value @@ resolved_profile: - $ref: "#/components/schemas/ApiDropResolvedIdentityProfileV2" + anyOf: + - type: "null" + - $ref: "#/components/schemas/ApiDropResolvedIdentityProfileV2" ApiDropResolvedIdentityProfileV2: allOf: - $ref: "#/components/schemas/ApiIdentityOverview" - type: object properties: bio: type: string + nullable: true top_rep_categories: type: array items: $ref: "#/components/schemas/ApiProfileRepCategorySummary"Also applies to: 9973-9983
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@openapi.yaml` around lines 9795 - 9808, The ApiDropMetadataV2 schema currently requires a non-null resolved_profile which tightens the contract; update the ApiDropMetadataV2 definition to allow resolved_profile to be nullable (add nullable: true or make it optional) and ensure the referenced ApiDropResolvedIdentityProfileV2 schema keeps its bio field nullable (or not required) so clients accept payloads without a profile or without a bio; apply the same nullable change to the duplicate ApiDropMetadataV2 occurrence elsewhere in the file (the other block referenced in the review).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@openapi.yaml`:
- Around line 2153-2197: The V2 endpoints getDropV2BoostsById and
getDropV2ReactionsById currently return unbounded arrays (items: ApiDropBoostV2
/ ApiDropReactionV2); reintroduce bounded pagination by adding standard query
parameters (e.g., page and page_size) to both operations and change the 200
response schema from a raw array to a paginated object (for example: { items:
array of ApiDropBoostV2 / ApiDropReactionV2, page: integer, page_size: integer,
total: integer }) so clients can incrementally load boosts and reactions while
keeping references to ApiDropBoostV2 and ApiDropReactionV2.
- Around line 6973-6978: The getWaveDropsV2 endpoint is inconsistent: the query
param drop_type uses ApiDropType (CHAT|PARTICIPATORY|WINNER) while the response
field ApiDropV2.drop_type is ApiDropMainType (CHAT|SUBMISSION); update the
contract so they match—either change the drop_type query parameter to reference
ApiDropMainType instead of ApiDropType, or widen ApiDropV2.drop_type to
ApiDropType; apply the same fix to the other occurrences mentioned (around the
other offsets) so all V2 endpoints and payloads consistently use the same enum
symbol (ApiDropMainType or ApiDropType) across getWaveDropsV2 and
ApiDropV2.drop_type.
- Around line 1999-2078: The /v2/boosted-drops response currently returns
ApiDropV2Page whose ApiDropV2 items lack their owning wave; fix by returning
wave context: either add a "wave" property to the ApiDropV2 schema (and update
ApiDropV2Page items to include it) or change the page item type to a compound
type (e.g., ApiDropAndWave) and update the /v2/boosted-drops get response $ref
to the new ApiDropAndWave page schema; ensure the chosen schema is used
consistently wherever ApiDropV2Page is returned for boosted-drop feeds
(including the same endpoints referenced in the review) so consumers can
group/render cross-wave boosted feeds.
---
Outside diff comments:
In `@openapi.yaml`:
- Around line 9795-9808: The ApiDropMetadataV2 schema currently requires a
non-null resolved_profile which tightens the contract; update the
ApiDropMetadataV2 definition to allow resolved_profile to be nullable (add
nullable: true or make it optional) and ensure the referenced
ApiDropResolvedIdentityProfileV2 schema keeps its bio field nullable (or not
required) so clients accept payloads without a profile or without a bio; apply
the same nullable change to the duplicate ApiDropMetadataV2 occurrence elsewhere
in the file (the other block referenced in the review).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3422f56b-5161-4a74-ae04-d3e099b7753b
⛔ Files ignored due to path filters (40)
generated/models/ApiDropAndWave.tsis excluded by!**/generated/**generated/models/ApiDropBoostV2.tsis excluded by!**/generated/**generated/models/ApiDropMainType.tsis excluded by!**/generated/**generated/models/ApiDropMetadataV2.tsis excluded by!**/generated/**generated/models/ApiDropPartQuoteV2.tsis excluded by!**/generated/**generated/models/ApiDropPartV2.tsis excluded by!**/generated/**generated/models/ApiDropReactionCounter.tsis excluded by!**/generated/**generated/models/ApiDropReactionV2.tsis excluded by!**/generated/**generated/models/ApiDropResolvedIdentityProfileV2.tsis excluded by!**/generated/**generated/models/ApiDropV2.tsis excluded by!**/generated/**generated/models/ApiDropV2ContextProfileContext.tsis excluded by!**/generated/**generated/models/ApiDropV2Page.tsis excluded by!**/generated/**generated/models/ApiDropV2PageWithoutCount.tsis excluded by!**/generated/**generated/models/ApiDropVoteEditLog.tsis excluded by!**/generated/**generated/models/ApiDropVoter.tsis excluded by!**/generated/**generated/models/ApiDropVotersPage.tsis excluded by!**/generated/**generated/models/ApiDropsLeaderboardPageV2.tsis excluded by!**/generated/**generated/models/ApiIdentityOverview.tsis excluded by!**/generated/**generated/models/ApiIdentityOverviewBadges.tsis excluded by!**/generated/**generated/models/ApiIdentityOverviewContextProfileContext.tsis excluded by!**/generated/**generated/models/ApiMentionedWaveV2.tsis excluded by!**/generated/**generated/models/ApiNotificationAdditionalContextV2.tsis excluded by!**/generated/**generated/models/ApiNotificationDropReactedReactor.tsis excluded by!**/generated/**generated/models/ApiNotificationV2.tsis excluded by!**/generated/**generated/models/ApiNotificationsResponseV2.tsis excluded by!**/generated/**generated/models/ApiReplyToDropAuthor.tsis excluded by!**/generated/**generated/models/ApiReplyToDropV2.tsis excluded by!**/generated/**generated/models/ApiSubmissionDropContext.tsis excluded by!**/generated/**generated/models/ApiSubmissionDropStatus.tsis excluded by!**/generated/**generated/models/ApiSubmissionDropVoting.tsis excluded by!**/generated/**generated/models/ApiSubmissionDropVotingContextProfileContext.tsis excluded by!**/generated/**generated/models/ApiWaveDecisionV2.tsis excluded by!**/generated/**generated/models/ApiWaveDecisionWinnerV2.tsis excluded by!**/generated/**generated/models/ApiWaveDecisionsPageV2.tsis excluded by!**/generated/**generated/models/ApiWaveDropsFeedV2.tsis excluded by!**/generated/**generated/models/ApiWaveOverview.tsis excluded by!**/generated/**generated/models/ApiWaveOverviewContextProfileContext.tsis excluded by!**/generated/**generated/models/ApiWaveOverviewPage.tsis excluded by!**/generated/**generated/models/ApiWavesV2ListType.tsis excluded by!**/generated/**generated/models/ObjectSerializer.tsis excluded by!**/generated/**
📒 Files selected for processing (1)
openapi.yaml



Summary by CodeRabbit
New Features
Improvements