Skip to content

docs: add GET /api/research/track/playlists endpoint#113

Open
sidneyswift wants to merge 2 commits intomainfrom
feat/research-track-playlists-docs
Open

docs: add GET /api/research/track/playlists endpoint#113
sidneyswift wants to merge 2 commits intomainfrom
feat/research-track-playlists-docs

Conversation

@sidneyswift
Copy link
Copy Markdown
Contributor

@sidneyswift sidneyswift commented Apr 7, 2026

Adds docs for the new track-level playlists endpoint (companion to api PR #366).

  • OpenAPI spec with full parameters, response schema, and error responses
  • New track-playlists.mdx page
  • Navigation entry added after the track page

Made 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.

  • New Features
    • OpenAPI path for GET /api/research/track/playlists with query params: id or q, artist, platform, status, editorial, since, until, sort, limit, offset.
    • Response schema ResearchTrackPlaylistsResponse plus 400/401 error responses.
    • New page api-reference/research/track-playlists.mdx and sidebar link after Track.

Written for commit 680b81a. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added a Research Track Playlists API endpoint to query playlists for a track by ID or query string, with artist, platform, status, editorial, date filters, sorting, and pagination.
  • Documentation

    • Added API reference and docs pages describing the new Research Track Playlists endpoint and its parameters and responses.

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Added a new Research API endpoint GET /api/research/track/playlists in the OpenAPI spec, with query parameters, response and error schemas, plus a documentation page and navigation entry.

Changes

Cohort / File(s) Summary
OpenAPI Specification
api-reference/openapi.json
Added GET /api/research/track/playlists path with query parameters (id, q, artist, platform, status, editorial, since, until, sort, limit, offset), responses (200ResearchTrackPlaylistsResponse, 400, 401), and new components.schemas.ResearchTrackPlaylistsResponse.
API Documentation & Navigation
api-reference/research/track-playlists.mdx, docs.json
Added documentation MDX page for the endpoint and registered the page in the Research navigation group.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • sweetmantech

Poem

🐰 Hopping through the spec so spry,

A playlist endpoint hops on by.
Tracks and pages, queries anew,
Docs and routes all set in view.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs: add GET /api/research/track/playlists endpoint' clearly and accurately summarizes the main change—adding documentation for a new API endpoint.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/research-track-playlists-docs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7882837 and 8e3bd9c.

📒 Files selected for processing (3)
  • api-reference/openapi.json
  • api-reference/research/track-playlists.mdx
  • docs.json

Comment on lines +6970 to +7004
"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
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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" },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
"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.

Comment on lines +1 to +4
---
title: 'Track Playlists'
openapi: 'GET /api/research/track/playlists'
---
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
---
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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Improves track search accuracy when using q= by allowing
artist name to narrow Spotify search results.

Made-with: Cursor
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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 $ref for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8e3bd9c and 680b81a.

📒 Files selected for processing (1)
  • api-reference/openapi.json

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.

1 participant