Implemented the POST, PUT and DELETE /users/{username}/wants/{release_id} endpoints for the Open API specification document in the library target.

This commit is contained in:
2025-10-16 18:12:37 +02:00
parent 298911a554
commit 8533fd0273
+125 -3
View File
@@ -1622,6 +1622,123 @@ paths:
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/users/{username}/wants/{release_id}:
put:
tags:
- User Wantlist
summary: Add a release into a wantlist of a user.
description: |
Adds a release to a wantlist of a user.
This endpoint requires authentication as the wantlist owner.
operationId: addToWantlist
parameters:
- $ref: '#/components/parameters/Username'
- $ref: '#/components/parameters/ReleaseId'
- $ref: '#/components/parameters/Notes'
- $ref: '#/components/parameters/Rating'
security:
- ConsumerKeySecret: []
- UserToken: []
- OAuth: []
responses:
'201':
description: Successfully added a release into a wantlist of a user.
headers:
X-Discogs-RateLimit:
$ref: '#/components/headers/RateLimit'
X-Discogs-RateLimit-Used:
$ref: '#/components/headers/RateLimitUsed'
X-Discogs-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
content:
application/json:
schema:
description: A type that represents a newly added release in a wantlist of a user.
$ref: '#/components/schemas/ReleaseInFolder'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/NotAccessable'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
post:
tags:
- User Wantlist
summary: Update a release into a wantlist of a user.
description: |
Modifies some metadata associated with a release in a wantlist of a user.
This endpoint requires authentication as the wantlist owner.
operationId: updateInWantlist
parameters:
- $ref: '#/components/parameters/Username'
- $ref: '#/components/parameters/ReleaseId'
- $ref: '#/components/parameters/Notes'
- $ref: '#/components/parameters/Rating'
security:
- ConsumerKeySecret: []
- UserToken: []
- OAuth: []
responses:
'200':
description: Successfully updated a release in a wantlist of a user.
headers:
X-Discogs-RateLimit:
$ref: '#/components/headers/RateLimit'
X-Discogs-RateLimit-Used:
$ref: '#/components/headers/RateLimitUsed'
X-Discogs-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
content:
application/json:
schema:
description: A type that represents an updated release in a wantlist of a user.
$ref: '#/components/schemas/ReleaseInFolder'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/NotAccessable'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
delete:
tags:
- User Wantlist
summary: Delete a release from a wantlist of a user.
description: |
Deletes a release from a wantlist of a user.
This endpoint requires authentication as the wantlist owner.
operationId: deleteFromWantlist
parameters:
- $ref: '#/components/parameters/Username'
- $ref: '#/components/parameters/ReleaseId'
security:
- ConsumerKeySecret: []
- UserToken: []
- OAuth: []
responses:
'204':
description: Successfully deleted a release from a wantlist of a user.
headers:
X-Discogs-RateLimit:
$ref: '#/components/headers/RateLimit'
X-Discogs-RateLimit-Used:
$ref: '#/components/headers/RateLimitUsed'
X-Discogs-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/NotAccessable'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
components:
headers:
Link:
@@ -1816,6 +1933,12 @@ components:
in: query
schema:
type: string
Notes:
description: A custom note about a release.
name: notes
in: query
schema:
type: string
Page:
description: A number of page of results to return.
name: page
@@ -1841,12 +1964,12 @@ components:
type: string
example: Some biographical information about a user goes here...
Rating:
description: A number (between 1 and 5) for a rating of a release.
description: A number for a rating of a release.
name: rating
in: query
schema:
type: integer
minimum: 1
minimum: 0
maximum: 5
ReleaseId:
description: An identifier of a release.
@@ -2708,7 +2831,6 @@ components:
- basic_information
- id
- date_added
- rating
ReleaseInstance:
description: A type that represents an instace of a release.
type: object