Implemented the GET /releases/{release-id}/stats endpoint for the Open API specification documentation in the library target.

This commit is contained in:
2025-10-09 18:21:31 +02:00
parent 8b1d727533
commit 5f271b2818
+42
View File
@@ -479,6 +479,33 @@ paths:
$ref: '#/components/schemas/ReleaseRatingByUser'
'404':
$ref: '#/components/responses/NotFound'
/releases/{release_id}/stats:
get:
tags:
- Database
summary: Get information about statistics of release.
description: Retrieves the total number of “haves” (in the community's collections) and “wants” (in the community's wantlists) for a given release.
operationId: getReleaseStats
parameters:
- $ref: '#/components/parameters/ReleaseId'
responses:
'200':
description: |
Successfully retrieved release rating details by a given user.
> warning: There is a discrepancy about this response between was is documented and what the endpoints actually responds. In the [documentation](https://www.discogs.com/developers#page:database,header:database-release-stats), it is defined that a type containing a statistical data would be returned but the actual response returns an object that contains a boolean flag instead.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/ReleaseStats'
- type: object
properties:
is_offensive:
type: boolean
required: true
'404':
$ref: '#/components/responses/NotFound'
components:
schemas:
Artist:
@@ -1131,6 +1158,21 @@ components:
- rating
- release_id
- username
ReleaseStats:
description: A type that represents the statistics of a release.
type: object
properties:
num_have:
description: A total number of users that have a release in their collection.
type: integer
minimum: 0
num_want:
description: A total number of users that have a release in their wantlist.
type: integer
minimum: 0
required:
- num_have
- num_want
ReleaseVersion:
description: A type that represents a version of a release.
type: object