Add library series endpoint and update deprecation

This commit is contained in:
Nicholas Wallace 2024-05-20 02:29:20 +00:00
parent 8c40fa5fdf
commit d293edfc05
4 changed files with 151 additions and 2 deletions

View file

@ -378,3 +378,58 @@ paths:
'404': '404':
$ref: '#/components/responses/library404' $ref: '#/components/responses/library404'
/api/libraries/{id}/series/{seriesId}:
parameters:
- name: id
in: path
description: The ID of the library.
required: true
schema:
$ref: '../objects/Library.yaml#/components/schemas/libraryId'
- name: seriesId
in: path
description: The ID of the series.
required: true
schema:
$ref: '../objects/entities/Series.yaml#/components/schemas/seriesId'
get:
operationId: getLibrarySeriesById
summary: Get single series in library
description: Get a single series in a library by ID on server.
tags:
- Libraries
requestBody:
required: false
description: The filters to apply to the requested library series.
content:
application/json:
schema:
type: object
properties:
limit:
$ref: '../schemas.yaml#/components/schemas/limit'
page:
$ref: '../schemas.yaml#/components/schemas/page'
sort:
description: The field to sort by from the request.
type: string
enum: ['name', 'numBooks', 'totalDuration', 'addedAt', 'lastBookAdded', 'lastBookUpdated']
example: 'numBooks'
default: 'name'
desc:
$ref: '../schemas.yaml#/components/schemas/sortDesc'
filter:
$ref: '#/components/schemas/libraryFilter'
minified:
$ref: '../schemas.yaml#/components/schemas/minified'
include:
$ref: '#/components/schemas/libraryInclude'
responses:
'200':
description: getLibrarySeriesById OK
content:
application/json:
schema:
$ref: '../objects/entities/Series.yaml#/components/schemas/seriesWithProgressAndRSS'
'404':
$ref: '#/components/responses/library404'

View file

@ -18,10 +18,11 @@ paths:
$ref: '../objects/entities/Series.yaml#/components/schemas/seriesId' $ref: '../objects/entities/Series.yaml#/components/schemas/seriesId'
get: get:
operationId: getSeries operationId: getSeries
deprecated: true
tags: tags:
- Series - Series
summary: Get series summary: Get series
description: Get a series by ID. description: Get a series by ID. This endpoint is deprecated and will be removed in the future. Use `/api/libraries/{id}/series/{seriesId}` instead.
requestBody: requestBody:
required: false required: false
description: A comma separated list of what to include with the series. description: A comma separated list of what to include with the series.

View file

@ -876,6 +876,96 @@
} }
} }
}, },
"/api/libraries/{id}/series/{seriesId}": {
"parameters": [
{
"name": "id",
"in": "path",
"description": "The ID of the library.",
"required": true,
"schema": {
"$ref": "#/components/schemas/libraryId"
}
},
{
"name": "seriesId",
"in": "path",
"description": "The ID of the series.",
"required": true,
"schema": {
"$ref": "#/components/schemas/seriesId"
}
}
],
"get": {
"operationId": "getLibrarySeriesById",
"summary": "Get single series in library",
"description": "Get a single series in a library by ID on server.",
"tags": [
"Libraries"
],
"requestBody": {
"required": false,
"description": "The filters to apply to the requested library series.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"limit": {
"$ref": "#/components/schemas/limit"
},
"page": {
"$ref": "#/components/schemas/page"
},
"sort": {
"description": "The field to sort by from the request.",
"type": "string",
"enum": [
"name",
"numBooks",
"totalDuration",
"addedAt",
"lastBookAdded",
"lastBookUpdated"
],
"example": "numBooks",
"default": "name"
},
"desc": {
"$ref": "#/components/schemas/sortDesc"
},
"filter": {
"$ref": "#/components/schemas/libraryFilter"
},
"minified": {
"$ref": "#/components/schemas/minified"
},
"include": {
"$ref": "#/components/schemas/libraryInclude"
}
}
}
}
}
},
"responses": {
"200": {
"description": "getLibrarySeriesById OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/seriesWithProgressAndRSS"
}
}
}
},
"404": {
"$ref": "#/components/responses/library404"
}
}
}
},
"/api/series/{id}": { "/api/series/{id}": {
"parameters": [ "parameters": [
{ {
@ -890,11 +980,12 @@
], ],
"get": { "get": {
"operationId": "getSeries", "operationId": "getSeries",
"deprecated": true,
"tags": [ "tags": [
"Series" "Series"
], ],
"summary": "Get series", "summary": "Get series",
"description": "Get a series by ID.", "description": "Get a series by ID. This endpoint is deprecated and will be removed in the future. Use `/api/libraries/{id}/series/{seriesId}` instead.",
"requestBody": { "requestBody": {
"required": false, "required": false,
"description": "A comma separated list of what to include with the series.", "description": "A comma separated list of what to include with the series.",

View file

@ -33,6 +33,8 @@ paths:
$ref: './controllers/LibraryController.yaml#/paths/~1api~1libraries~1{id}~1issues' $ref: './controllers/LibraryController.yaml#/paths/~1api~1libraries~1{id}~1issues'
/api/libraries/{id}/series: /api/libraries/{id}/series:
$ref: './controllers/LibraryController.yaml#/paths/~1api~1libraries~1{id}~1series' $ref: './controllers/LibraryController.yaml#/paths/~1api~1libraries~1{id}~1series'
/api/libraries/{id}/series/{seriesId}:
$ref: './controllers/LibraryController.yaml#/paths/~1api~1libraries~1{id}~1series~1{seriesId}'
/api/series/{id}: /api/series/{id}:
$ref: './controllers/SeriesController.yaml#/paths/~1api~1series~1{id}' $ref: './controllers/SeriesController.yaml#/paths/~1api~1series~1{id}'
tags: tags: