Add: /api/libraries/{id} endpoint

This commit is contained in:
Nicholas Wallace 2024-05-12 07:01:46 +00:00
parent 8c85092349
commit 2621d04e4b
2 changed files with 84 additions and 0 deletions

View file

@ -17,6 +17,15 @@ components:
type: array type: array
items: items:
$ref: '../objects/Folder.yaml#/components/schemas/folder' $ref: '../objects/Folder.yaml#/components/schemas/folder'
libraryDisplayOrder:
name: displayOrder
in: query
description: The display order of the library. Must be >= 1.
required: false
schema:
type: integer
minimum: 1
example: 1
libraryIcon: libraryIcon:
name: icon name: icon
in: query in: query
@ -48,3 +57,28 @@ components:
required: false required: false
schema: schema:
$ref: '../objects/Library.yaml#/components/schemas/librarySettings' $ref: '../objects/Library.yaml#/components/schemas/librarySettings'
libraryId:
name: id
in: query
description: The ID of the library.
required: true
schema:
type: string
format: uuid
example: e4bb1afb-4a4f-4dd6-8be0-e615d233185b
librarySettings:
name: settings
in: query
description: The settings for the library.
required: false
schema:
$ref: '../objects/Library.yaml#/components/schemas/librarySettings'
responses:
library404:
description: Library not found.
content:
text/html:
schema:
type: string
example: Library not found.

View file

@ -187,6 +187,56 @@ paths:
application/json: application/json:
schema: schema:
$ref: './objects/Library.yaml#/components/schemas/library' $ref: './objects/Library.yaml#/components/schemas/library'
/api/libraries/{id}:
get:
operationId: getLibraryById
summary: Get a single library by ID on server
tags:
- Libraries
parameters:
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryId'
responses:
'200':
description: getLibraryById OK
content:
application/json:
schema:
$ref: './objects/Library.yaml#/components/schemas/library'
'404':
$ref: './controllers/LibraryController.yaml#/components/responses/library404'
patch:
operationId: updateLibraryById
summary: Update a single library by ID on server
tags:
- Libraries
parameters:
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryName'
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryFolders'
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryDisplayOrder'
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryIcon'
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryProvider'
- $ref: './controllers/LibraryController.yaml#/components/parameters/librarySettings'
responses:
'200':
description: updateLibraryById OK
content:
application/json:
schema:
$ref: './objects/Library.yaml#/components/schemas/library'
'404':
$ref: './controllers/LibraryController.yaml#/components/responses/library404'
delete:
operationId: deleteLibraryById
summary: Delete a single library by ID on server
tags:
- Libraries
parameters:
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryId'
responses:
'200':
$ref: '#/components/responses/ok200'
'404':
$ref: './controllers/LibraryController.yaml#/components/responses/library404'
tags: tags:
- name: Authors - name: Authors
description: Author endpoints description: Author endpoints