Implemented the GET /artists/{artist-id}/releases endpoint for the Open API specification documentation in the library target.
This commit is contained in:
@@ -277,6 +277,41 @@ paths:
|
||||
$ref: '#/components/schemas/Artist'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
/artists/{artist_id}/releases:
|
||||
get:
|
||||
tags:
|
||||
- Database
|
||||
summary: Get information about releases of an artist.
|
||||
description: |
|
||||
Returns a list of releases and masters associated with an artist.
|
||||
|
||||
This endpoint supports pagination.
|
||||
operationId: getArtistReleases
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ArtistId'
|
||||
- $ref: '#/components/parameters/ArtistReleasesSort'
|
||||
- $ref: '#/components/parameters/SortOrder'
|
||||
- $ref: '#/components/parameters/Page'
|
||||
- $ref: '#/components/parameters/PerPage'
|
||||
responses:
|
||||
'200':
|
||||
description: A paginated list of releases of an artist.
|
||||
headers:
|
||||
Link:
|
||||
$ref: '#/components/headers/Link'
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
pagination:
|
||||
$ref: '#/components/schemas/Pagination'
|
||||
releases:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ArtistRelease'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
components:
|
||||
schemas:
|
||||
Artist:
|
||||
@@ -377,6 +412,58 @@ components:
|
||||
- id
|
||||
- name
|
||||
- resource_url
|
||||
ArtistRelease:
|
||||
description: A type that represents a release of an artist.
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
description: An identifier of a release.
|
||||
type: integer
|
||||
readOnly: true
|
||||
resource_url:
|
||||
description: A URI resource of a release.
|
||||
type: string
|
||||
format: uri
|
||||
readOnly: true
|
||||
type:
|
||||
description: A type of a release.
|
||||
type: string
|
||||
enum:
|
||||
- release
|
||||
- master
|
||||
title:
|
||||
description: A title of a release.
|
||||
type: string
|
||||
thumb:
|
||||
description: A URL link to a thumbnail of a release.
|
||||
type: string
|
||||
format: uri
|
||||
artist:
|
||||
description: A name for the artist of a release.
|
||||
type: string
|
||||
role:
|
||||
description: A role of a release.
|
||||
type: string
|
||||
year:
|
||||
description: A number of year of a release.
|
||||
type: integer
|
||||
format:
|
||||
description: A format of a release.
|
||||
type: string
|
||||
label:
|
||||
description: A label of a release.
|
||||
type: string
|
||||
status:
|
||||
description: A status of a release.
|
||||
type: string
|
||||
required:
|
||||
- artist
|
||||
- id
|
||||
- resource_url
|
||||
- role
|
||||
- title
|
||||
- thumb
|
||||
- type
|
||||
Image:
|
||||
description: A type that represents an image of a resource.
|
||||
type: object
|
||||
@@ -414,6 +501,48 @@ components:
|
||||
- uri
|
||||
- uri150
|
||||
- width
|
||||
Pagination:
|
||||
description: A type that provides details about a paginated result.
|
||||
type: object
|
||||
properties:
|
||||
page:
|
||||
description: A number for the current page in a result.
|
||||
type: integer
|
||||
pages:
|
||||
description: A total number of pages in a result.
|
||||
type: integer
|
||||
per_page:
|
||||
description: A total number of items per page in a result.
|
||||
type: integer
|
||||
items:
|
||||
description: A total number of items in a result.
|
||||
type: integer
|
||||
urls:
|
||||
description: A collection of URLs to navigate through the pages in a result.
|
||||
type: object
|
||||
properties:
|
||||
first:
|
||||
description: A URL link to the first page in a result, if any.
|
||||
type: string
|
||||
format: uri
|
||||
prev:
|
||||
description: A URL link to a previous page in a result, if any.
|
||||
type: string
|
||||
format: uri
|
||||
next:
|
||||
description: A URL link to a next page in a result, if any.
|
||||
type: string
|
||||
format: uri
|
||||
last:
|
||||
description: A URL link to the last page in a result, if any.
|
||||
type: string
|
||||
format: uri
|
||||
required:
|
||||
- page
|
||||
- pages
|
||||
- per_page
|
||||
- items
|
||||
- urls
|
||||
Service:
|
||||
description: A type that encapsulates any available information about the service.
|
||||
type: object
|
||||
@@ -468,6 +597,53 @@ components:
|
||||
schema:
|
||||
type: integer
|
||||
example: 108713
|
||||
ArtistReleasesSort:
|
||||
description: A value to sort the releases of an artist by.
|
||||
name: sort
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- year
|
||||
- title
|
||||
- format
|
||||
Page:
|
||||
description: A number of page of results to return.
|
||||
name: page
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
PerPage:
|
||||
description: A number of items to return per page.
|
||||
name: per_page
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
SortOrder:
|
||||
description: The order to sort the results.
|
||||
name: sort_order
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- asc
|
||||
- desc
|
||||
headers:
|
||||
Link:
|
||||
description: |
|
||||
Contains URLs for pagination, compliant with RFC 5988.
|
||||
|
||||
It provides `first`, `prev`, `next`, and `last` links where applicable.
|
||||
schema:
|
||||
type: string
|
||||
example: <https://api.discogs.com/artists/1/releases?page=2&per_page=75>; rel="next", <https://api.discogs.com/artists/1/releases?page=30&per_page=75>; rel="last"
|
||||
responses:
|
||||
NotFound:
|
||||
description: A requested resource cannot be found.
|
||||
|
||||
Reference in New Issue
Block a user