Implemented the GET /masters/{master-id}/versions endpoint for the Open API specification documentation in the library target.

This commit is contained in:
2025-10-09 16:34:29 +02:00
parent 8ea8b082be
commit 21b54ddbc7
+147
View File
@@ -384,6 +384,45 @@ paths:
$ref: '#/components/schemas/Master'
'404':
$ref: '#/components/responses/NotFound'
/masters/{master_id}/versions:
get:
tags:
- Database
summary: Get master release versions
description: |
Retrieves a list of all releases that are versions of the specified master release.
This request supports pagination.
operationId: getMasterVersions
parameters:
- $ref: '#/components/parameters/MasterId'
- $ref: '#/components/parameters/Format'
- $ref: '#/components/parameters/Label'
- $ref: '#/components/parameters/Released'
- $ref: '#/components/parameters/Country'
- $ref: '#/components/parameters/MasterVersionsSort'
- $ref: '#/components/parameters/SortOrder'
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
responses:
'200':
description: A paginated list of releases belonging to the master.
headers:
Link:
$ref: '#/components/headers/Link'
content:
application/json:
schema:
type: object
properties:
pagination:
$ref: '#/components/schemas/Pagination'
versions:
type: array
items:
$ref: '#/components/schemas/ReleaseVersion'
'404':
$ref: '#/components/responses/NotFound'
components:
schemas:
Artist:
@@ -984,6 +1023,77 @@ components:
- name
- qty
- descriptions
ReleaseVersion:
description: A type that represents a version of a release.
type: object
properties:
id:
description: An identifier of a release version.
type: integer
readOnly: true
resource_url:
description: A URI resource of a release version.
type: string
format: uri
readOnly: true
status:
description: A status of a release version.
type: string
thumb:
description: A URL link to a thumbnail of a release version.
type: string
format: uri
format:
description: A format of a release version.
type: string
country:
description: A country of a release version, if any.
type: string
title:
description: A title of a release version.
type: string
label:
description: A label of a release version.
type: string
released:
description: A release year of a release version.
type: string
major_formats:
description: A list of formats of a release version.
type: array
items:
type: string
catno:
description: A category number of a release version, if any.
type: string
stats:
description: A type contains statictics about a release version.
type: object
properties:
community:
description: A type that represents the relationship between users and a release version.
type: object
properties:
in_collection:
description: A total number of users that have a release version in their collections.
type: integer
in_wantlist:
description: A total number of users that have a release version in their wantlist.
type: integer
required:
- in_collection
- in_wantlist
required:
- format
- id
- label
- major_formats
- released
- resource_url
- stats
- status
- thumb
- title
Service:
description: A type that encapsulates any available information about the service.
type: object
@@ -1115,6 +1225,37 @@ components:
- year
- title
- format
Country:
description: A filter by country.
name: country
in: query
schema:
type: string
Format:
description: A filter by format.
name: format
in: query
schema:
type: string
MasterVersionsSort:
description: A value to sort the master versions by.
name: sort
in: query
schema:
type: string
enum:
- released
- title
- format
- label
- catno
- country
Label:
description: A filter by label.
name: label
in: query
schema:
type: string
LabelId:
description: An identifier of a label.
name: label_id
@@ -1148,6 +1289,12 @@ components:
type: integer
minimum: 1
maximum: 100
Released:
description: A filter by release year.
name: released
in: query
schema:
type: string
SortOrder:
description: The order to sort the results.
name: sort_order