-
Notifications
You must be signed in to change notification settings - Fork 4
docs(artists): POST /api/artists resolve-or-create by spotify_artist_id (chat#1889 row 8) #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -554,7 +554,7 @@ | |
| } | ||
| }, | ||
| "post": { | ||
| "description": "Create a new artist account. The artist can optionally be linked to an organization.", | ||
| "description": "Create a new artist account. When spotify_artist_id is provided and a canonical artist already exists for it, the existing artist is linked to the account instead of creating a duplicate. The artist can optionally be linked to an organization.", | ||
| "requestBody": { | ||
| "description": "Artist creation parameters", | ||
| "required": true, | ||
|
|
@@ -567,6 +567,16 @@ | |
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "description": "Existing canonical artist for the given spotify_artist_id linked to the account (no new artist created)", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "$ref": "#/components/schemas/CreateArtistResponse" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
|
Comment on lines
+570
to
+579
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Use a typed, neutral artist response schema.
🤖 Prompt for AI Agents |
||
| "201": { | ||
| "description": "Artist created successfully", | ||
| "content": { | ||
|
|
@@ -2822,6 +2832,10 @@ | |
| "minLength": 1, | ||
| "description": "The name of the artist to create" | ||
| }, | ||
| "spotify_artist_id": { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: spotify_artist_id has no minLength constraint, so "spotify_artist_id": "" would still validate against the schema even though invalid IDs are documented to return 400 elsewhere. Add minLength: 1 if empty strings should be rejected, or update the description to clarify that empty values are accepted. Prompt for AI agents |
||
| "type": "string", | ||
| "description": "Optional Spotify artist id. When provided, the endpoint resolves-or-creates the canonical artist for that id: if an artist already carries it, that artist is linked to the account and returned (200) instead of creating a duplicate; otherwise the artist is created with its Spotify profile attached (201)." | ||
| }, | ||
|
Comment on lines
+2835
to
+2838
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C5 '\bspotify_artist_id\b' . \
-g '!api-reference/openapi/releases.json'Repository: recoupable/docs Length of output: 153 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Files with spotify_artist_id:\n'
rg -n -C3 '\bspotify_artist_id\b' . || true
printf '\nRelevant OpenAPI section:\n'
sed -n '2828,2842p' api-reference/openapi/releases.json
printf '\nRepo file count and type evidence:\n'
git ls-files | wc -l
git ls-files | sed -n '1,120p'Repository: recoupable/docs Length of output: 8846 Clarify and constrain the optional Spotify artist ID.
🤖 Prompt for AI Agents |
||
| "account_id": { | ||
| "type": "string", | ||
| "format": "uuid", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: The new 200 response for the resolve-or-create flow reuses CreateArtistResponse, but the underlying account_socials array lacks an items schema, so generated clients won't get a typed shape for the server-attached Spotify profile. Consider typing the social entries so both the resolve and create paths accurately expose the response shape.
Prompt for AI agents