From 9134598b6accd7c0ffd42b0650b5c4a672de5333 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Thu, 9 Oct 2025 17:03:16 +0200 Subject: [PATCH] Implemented the GET /releases/{release-id}/rating endpoint for the Open API specification documentation in the library target. --- Sources/DiscogsService/openapi.yaml | 59 ++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/Sources/DiscogsService/openapi.yaml b/Sources/DiscogsService/openapi.yaml index 1c92f8eef..c22c6a7e5 100644 --- a/Sources/DiscogsService/openapi.yaml +++ b/Sources/DiscogsService/openapi.yaml @@ -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