docs: add GET /api/research/track/playlists endpoint#113
docs: add GET /api/research/track/playlists endpoint#113sidneyswift wants to merge 2 commits intomainfrom
Conversation
OpenAPI spec with parameters (id, q, platform, status, editorial, sort, limit, offset, since, until), response schema (ResearchTrackPlaylistsResponse), and 400/401 error responses. Navigation entry added after track page. Made-with: Cursor
📝 WalkthroughWalkthroughAdded a new Research API endpoint Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@api-reference/openapi.json`:
- Line 15250: The OpenAPI schema for the property "playlist_id" currently uses
platform-specific wording ("Spotify playlist ID"); update the description for
the "playlist_id" schema entry to a platform-neutral phrase such as "Platform
playlist ID" or "ID of the playlist on the source platform" so it accurately
reflects multi-platform support; locate the "playlist_id" schema key in the
OpenAPI document (property name "playlist_id") and replace the description
string accordingly.
- Around line 6970-7004: The OpenAPI parameter schemas for 'since' and 'until'
are missing the date format and the 'limit' parameter lacks the maximum
constraint; update the schema objects for the query parameters named "since" and
"until" to include "format": "date" (to match the YYYY-MM-DD description) and
update the "limit" parameter's schema to add "maximum": 100 (and optionally
"minimum": 1) so the schema contract matches the documented constraints.
In `@api-reference/research/track-playlists.mdx`:
- Around line 1-4: The frontmatter in the Track Playlists MDX file is missing a
description field; update the frontmatter block (the YAML with title: 'Track
Playlists' and openapi: 'GET /api/research/track/playlists') to include a
descriptive description: string summarizing the page (e.g., "Retrieve playlists
for research tracks" or similar) so the file follows the MDX frontmatter
guideline requiring title and description metadata.
🪄 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: 3024f63f-0563-4a0f-a2d3-1189e8711526
📒 Files selected for processing (3)
api-reference/openapi.jsonapi-reference/research/track-playlists.mdxdocs.json
| "name": "since", | ||
| "in": "query", | ||
| "required": false, | ||
| "description": "Filter by start date (YYYY-MM-DD).", | ||
| "schema": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| { | ||
| "name": "until", | ||
| "in": "query", | ||
| "required": false, | ||
| "description": "Filter by end date (YYYY-MM-DD).", | ||
| "schema": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| { | ||
| "name": "sort", | ||
| "in": "query", | ||
| "required": false, | ||
| "description": "Sort results by this field (e.g. followers, added_at, position).", | ||
| "schema": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| { | ||
| "name": "limit", | ||
| "in": "query", | ||
| "required": false, | ||
| "description": "Maximum number of results (max 100).", | ||
| "schema": { | ||
| "type": "integer", | ||
| "default": 10 | ||
| } |
There was a problem hiding this comment.
Align schema constraints with the parameter descriptions.
since/until are documented as YYYY-MM-DD but lack format: date, and limit says max 100 without a maximum constraint. This creates a doc/contract mismatch for generated clients and validators.
Proposed patch
{
"name": "since",
"in": "query",
"required": false,
"description": "Filter by start date (YYYY-MM-DD).",
"schema": {
- "type": "string"
+ "type": "string",
+ "format": "date"
}
},
{
"name": "until",
"in": "query",
"required": false,
"description": "Filter by end date (YYYY-MM-DD).",
"schema": {
- "type": "string"
+ "type": "string",
+ "format": "date"
}
},
@@
{
"name": "limit",
"in": "query",
"required": false,
"description": "Maximum number of results (max 100).",
"schema": {
"type": "integer",
- "default": 10
+ "default": 10,
+ "minimum": 1,
+ "maximum": 100
}
},🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api-reference/openapi.json` around lines 6970 - 7004, The OpenAPI parameter
schemas for 'since' and 'until' are missing the date format and the 'limit'
parameter lacks the maximum constraint; update the schema objects for the query
parameters named "since" and "until" to include "format": "date" (to match the
YYYY-MM-DD description) and update the "limit" parameter's schema to add
"maximum": 100 (and optionally "minimum": 1) so the schema contract matches the
documented constraints.
| "properties": { | ||
| "name": { "type": "string", "description": "Playlist name" }, | ||
| "image_url": { "type": "string", "description": "Playlist cover image URL" }, | ||
| "playlist_id": { "type": "string", "description": "Spotify playlist ID" }, |
There was a problem hiding this comment.
Use platform-neutral wording for playlist_id.
The schema says “Spotify playlist ID”, but this endpoint is documented for multiple platforms. Consider neutral wording (e.g., “Platform playlist ID”).
Proposed patch
- "playlist_id": { "type": "string", "description": "Spotify playlist ID" },
+ "playlist_id": { "type": "string", "description": "Platform playlist ID" },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "playlist_id": { "type": "string", "description": "Spotify playlist ID" }, | |
| "playlist_id": { "type": "string", "description": "Platform playlist ID" }, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api-reference/openapi.json` at line 15250, The OpenAPI schema for the
property "playlist_id" currently uses platform-specific wording ("Spotify
playlist ID"); update the description for the "playlist_id" schema entry to a
platform-neutral phrase such as "Platform playlist ID" or "ID of the playlist on
the source platform" so it accurately reflects multi-platform support; locate
the "playlist_id" schema key in the OpenAPI document (property name
"playlist_id") and replace the description string accordingly.
| --- | ||
| title: 'Track Playlists' | ||
| openapi: 'GET /api/research/track/playlists' | ||
| --- |
There was a problem hiding this comment.
Add description to frontmatter for consistency.
This API page is correctly frontmatter-only, but it’s missing a description field.
Proposed fix
---
title: 'Track Playlists'
+description: 'Get playlists associated with a track in Research.'
openapi: 'GET /api/research/track/playlists'
---As per coding guidelines, "**/*.mdx: Use MDX (Markdown + JSX) for documentation pages with frontmatter for page metadata (title, description)".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| --- | |
| title: 'Track Playlists' | |
| openapi: 'GET /api/research/track/playlists' | |
| --- | |
| --- | |
| title: 'Track Playlists' | |
| description: 'Get playlists associated with a track in Research.' | |
| openapi: 'GET /api/research/track/playlists' | |
| --- |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api-reference/research/track-playlists.mdx` around lines 1 - 4, The
frontmatter in the Track Playlists MDX file is missing a description field;
update the frontmatter block (the YAML with title: 'Track Playlists' and
openapi: 'GET /api/research/track/playlists') to include a descriptive
description: string summarizing the page (e.g., "Retrieve playlists for research
tracks" or similar) so the file follows the MDX frontmatter guideline requiring
title and description metadata.
Improves track search accuracy when using q= by allowing artist name to narrow Spotify search results. Made-with: Cursor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
api-reference/openapi.json (1)
7037-7063: Extract duplicated 400/401 error schema into a shared component.The inline schemas are identical and likely to drift. Use a single
$reffor both responses.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-reference/openapi.json` around lines 7037 - 7063, Extract the duplicated inline object schema used by the "400" and "401" responses into a single shared component (e.g., create components.schemas.ErrorResponse or components.responses.ErrorResponse) defining the { status: string, error: string } shape, then replace each inline response schema for "400" and "401" with a $ref to that new component (e.g., "$ref": "#/components/schemas/ErrorResponse"); update only the schema blocks referenced by the "400" and "401" response objects so both responses point to the single shared definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@api-reference/openapi.json`:
- Around line 7037-7063: Extract the duplicated inline object schema used by the
"400" and "401" responses into a single shared component (e.g., create
components.schemas.ErrorResponse or components.responses.ErrorResponse) defining
the { status: string, error: string } shape, then replace each inline response
schema for "400" and "401" with a $ref to that new component (e.g., "$ref":
"#/components/schemas/ErrorResponse"); update only the schema blocks referenced
by the "400" and "401" response objects so both responses point to the single
shared definition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 43dd8b4d-252d-4ffc-af67-874845ffc112
📒 Files selected for processing (1)
api-reference/openapi.json
Adds docs for the new track-level playlists endpoint (companion to api PR #366).
track-playlists.mdxpageMade with Cursor
Summary by cubic
Adds docs for GET
/api/research/track/playlists, which lists editorial, algorithmic, and indie playlists that feature a track. Includes OpenAPI spec, a new docs page, and a nav entry./api/research/track/playlistswith query params:idorq,artist,platform,status,editorial,since,until,sort,limit,offset.ResearchTrackPlaylistsResponseplus 400/401 error responses.api-reference/research/track-playlists.mdxand sidebar link after Track.Written for commit 680b81a. Summary will update on new commits.
Summary by CodeRabbit
New Features
Documentation