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

This commit is contained in:
2025-10-09 17:03:16 +02:00
parent b8f5c4bad3
commit 9134598b6a
+46 -13
View File
@@ -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