docs: tighten research endpoint schemas to match handler enforcement#134
Conversation
Align OpenAPI spec with the validation the handlers actually enforce: Enums (docs were permissive, handlers restrict): - /research/metrics source: 14-item enum (spotify, tiktok, youtube_*, etc.) - /research/playlist platform: spotify|applemusic|deezer|amazon|youtube - /research/playlists platform: same 5-value enum - /research/track/playlists platform: spotify|applemusic|deezer|amazon (no youtube, matching handler); status: current|past - /research/similar audience|genre|mood|musicality: high|medium|low Missing query params documented: - /research/playlists: indie, majorCurator, popularIndie, personalized, chart Validation constraints: - /research/charts platform pattern: ^[a-z]+$ - /research/discover country: minLength/maxLength 2 - /research/discover limit: minimum 1, maximum 100 - ResearchExtractRequest.urls: minItems 1 Surfaced by cross-checking routes in recoupable/api#366 against the openapi spec. No behavior change — docs only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughUpdated OpenAPI parameter validation and defaults for research API endpoints in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
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.
🧹 Nitpick comments (1)
api-reference/openapi/research.json (1)
4026-4027: Updateurlsdescription text to include the new minimum.Schema now enforces at least one URL, but the description still only states max count. Consider making the text reflect both bounds.
✏️ Proposed doc-text tweak
- "description": "URLs to extract content from (max 10).", + "description": "URLs to extract content from (min 1, max 10).",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-reference/openapi/research.json` around lines 4026 - 4027, Update the "urls" property description to reflect both bounds: mention that the array requires at least 1 URL and allows up to 10 (e.g., "URLs to extract content from (min 1, max 10)"). Locate the "urls" schema description in the OpenAPI JSON (the property named "urls") and replace the existing text that only mentions the max with a concise description that includes both min and max constraints.
🤖 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/research.json`:
- Around line 4026-4027: Update the "urls" property description to reflect both
bounds: mention that the array requires at least 1 URL and allows up to 10
(e.g., "URLs to extract content from (min 1, max 10)"). Locate the "urls" schema
description in the OpenAPI JSON (the property named "urls") and replace the
existing text that only mentions the max with a concise description that
includes both min and max constraints.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5b2833cc-5cfd-4dcc-892b-892b233e8872
📒 Files selected for processing (1)
api-reference/openapi/research.json
Summary
Align `api-reference/openapi/research.json` with the validation the research handlers in recoupable/api#366 actually enforce. No behavior change — docs-only cleanup that surfaces existing enums and constraints previously hidden.
Enums added
Missing query params added
Validation constraints
Test plan
🤖 Generated with Claude Code
Summary by cubic
Tightens research endpoint schemas in
api-reference/openapi/research.jsonto match handler validation. Adds enums, missing playlist filters, and input constraints so the docs reflect real behavior; no API change./research/metricssource (14 values); playlistplatformfor/research/playlistand/research/playlists(spotify|applemusic|deezer|amazon|youtube);/research/track/playlistsplatform (spotify|applemusic|deezer|amazon) +status(current|past);/research/similarweights (audience,genre,mood,musicality) set to high|medium|low with default medium./research/playlistsfiltersindie,majorCurator,popularIndie,personalized,chart./research/chartsplatform pattern^[a-z]+$;/research/discovercountry length 2 and limit 1–100;ResearchExtractRequest.urlsnowminItems: 1.Written for commit a586cb7. Summary will update on new commits.
Summary by CodeRabbit
New Features
indie,majorCurator,popularIndie,personalized,chart).Bug Fixes