Implemented the GET /releases/{release-id}/stats endpoint for the Open API specification documentation in the library target.
This commit is contained in:
@@ -479,6 +479,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/ReleaseRatingByUser'
|
$ref: '#/components/schemas/ReleaseRatingByUser'
|
||||||
'404':
|
'404':
|
||||||
$ref: '#/components/responses/NotFound'
|
$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:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
Artist:
|
Artist:
|
||||||
@@ -1131,6 +1158,21 @@ components:
|
|||||||
- rating
|
- rating
|
||||||
- release_id
|
- release_id
|
||||||
- username
|
- 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:
|
ReleaseVersion:
|
||||||
description: A type that represents a version of a release.
|
description: A type that represents a version of a release.
|
||||||
type: object
|
type: object
|
||||||
|
|||||||
Reference in New Issue
Block a user