Add Albums endpoints

This commit is contained in:
Deluan 2023-05-22 20:45:18 -04:00 • committed by Deluan
commit 90c2d7d1cf
12 changed files with 203 additions and 95 deletions

View file

@ -22,3 +22,7 @@ sort:
$ref: './query/sort.yml'
include:
$ref: './query/include.yml'
includeForTracks:
$ref: './query/includeForTracks.yml'
includeForAlbums:
$ref: './query/includeForAlbums.yml'

View file

@ -0,0 +1,13 @@
name: include
in: query
description: Related resources to include in the response, separated by commas
required: false
explode: false
schema:
type: array
x-go-type: includeSlice
items:
type: string
enum:
- track
- artist

View file

@ -0,0 +1,13 @@
name: include
in: query
description: Related resources to include in the response, separated by commas
required: false
explode: false
schema:
type: array
x-go-type: includeSlice
items:
type: string
enum:
- album
- artist

View file

@ -2,7 +2,7 @@ get:
summary: Retrieve an individual album
operationId: getAlbum
parameters:
- $ref: '../parameters/query/include.yml'
- $ref: '../parameters/query/includeForAlbums.yml'
- name: albumId
in: path
description: The unique identifier of the album

View file

@ -13,7 +13,7 @@ get:
- $ref: '../parameters/query/filterStartsWith.yml'
- $ref: '../parameters/query/filterEndsWith.yml'
- $ref: '../parameters/query/sort.yml'
- $ref: '../parameters/query/include.yml'
- $ref: '../parameters/query/includeForAlbums.yml'
responses:
'200':
description: A list of albums

View file

@ -2,7 +2,7 @@ get:
summary: Retrieve an individual track
operationId: getTrack
parameters:
- $ref: '../parameters/query/include.yml'
- $ref: '../parameters/query/includeForTracks.yml'
- name: trackId
in: path
description: The unique identifier of the track

View file

@ -1,5 +1,5 @@
get:
summary: Get a list of tracks
summary: Retrieve a list of tracks
operationId: getTracks
parameters:
- $ref: '../parameters/query/pageLimit.yml'
@ -13,7 +13,7 @@ get:
- $ref: '../parameters/query/filterStartsWith.yml'
- $ref: '../parameters/query/filterEndsWith.yml'
- $ref: '../parameters/query/sort.yml'
- $ref: '../parameters/query/include.yml'
- $ref: '../parameters/query/includeForTracks.yml'
responses:
'200':
description: A list of tracks

View file

@ -3,14 +3,21 @@ properties:
title:
type: string
description: The title of the album
artist:
type: string
description: The artist of the album
releaseDate:
type: string
format: date
description: The release date of the album
tracktotal:
type: integer
description: The number of tracks on the album
disctotal:
type: integer
description: The number of discs in the album
genre:
type: string
description: The genre of the album
required:
- title
- releaseDate
- genre
- artist