Implemented the GET /releases/{release-id}/rating endpoint for the Open API specification documentation in the library target.
This commit is contained in:
@@ -442,6 +442,24 @@ paths:
|
||||
$ref: '#/components/schemas/Release'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
/releases/{release_id}/rating:
|
||||
get:
|
||||
tags:
|
||||
- Database
|
||||
summary: Get information about a rating of release.
|
||||
description: Retrieves the average rating and the total number of user ratings for a given release.
|
||||
operationId: getReleaseRating
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ReleaseId'
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved release details.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ReleaseRating'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
components:
|
||||
schemas:
|
||||
Artist:
|
||||
@@ -604,19 +622,7 @@ components:
|
||||
description: A number of users that want a release.
|
||||
type: integer
|
||||
rating:
|
||||
description: A type that represents a community rating of a release.
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
description: A number of ratings given by users of a release.
|
||||
type: integer
|
||||
average:
|
||||
description: An average of the ratings given by users of a release.
|
||||
type: number
|
||||
format: float
|
||||
required:
|
||||
- average
|
||||
- count
|
||||
$ref: '#/components/schemas/Rating'
|
||||
submitter:
|
||||
description: A reference of a user that submitted the release into the database.
|
||||
$ref: '#/components/schemas/UserId'
|
||||
@@ -897,6 +903,20 @@ components:
|
||||
- per_page
|
||||
- items
|
||||
- urls
|
||||
Rating:
|
||||
description: A type that represents a community rating of a release.
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
description: A number of ratings given by users of a release.
|
||||
type: integer
|
||||
average:
|
||||
description: An average of the ratings given by users of a release.
|
||||
type: number
|
||||
format: float
|
||||
required:
|
||||
- average
|
||||
- count
|
||||
Release:
|
||||
description: A type that eepresents a particular physical or digital object released by one or more artists.
|
||||
type: object
|
||||
@@ -1058,6 +1078,19 @@ components:
|
||||
- name
|
||||
- qty
|
||||
- descriptions
|
||||
ReleaseRating:
|
||||
description: A type that represents a community rating of a release.
|
||||
type: object
|
||||
properties:
|
||||
rating:
|
||||
$ref: '#/components/schemas/Rating'
|
||||
release_id:
|
||||
description: An identifier of a release.
|
||||
type: integer
|
||||
readOnly: true
|
||||
required:
|
||||
- rating
|
||||
- release_id
|
||||
ReleaseVersion:
|
||||
description: A type that represents a version of a release.
|
||||
type: object
|
||||
|
||||
Reference in New Issue
Block a user