mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Move: libraryController paths, clean up requestBody
This commit is contained in:
parent
5795d01621
commit
535e88f028
2 changed files with 105 additions and 100 deletions
|
|
@ -1,27 +1,29 @@
|
||||||
components:
|
components:
|
||||||
parameters:
|
requestBody:
|
||||||
libraryName:
|
libraryName:
|
||||||
name: name
|
name: name
|
||||||
in: requestBody
|
in: requestBody
|
||||||
description: The name of the library.
|
description: The name of the library.
|
||||||
required: true
|
content:
|
||||||
schema:
|
application/json:
|
||||||
type: string
|
schema:
|
||||||
example: My Audiobooks
|
type: string
|
||||||
|
example: My Audiobooks
|
||||||
libraryFolders:
|
libraryFolders:
|
||||||
name: folders
|
name: folders
|
||||||
in: requestBody
|
in: requestBody
|
||||||
|
summary: The folders of the library.
|
||||||
description: The folders of the library. Only specify the fullPath.
|
description: The folders of the library. Only specify the fullPath.
|
||||||
required: true
|
content:
|
||||||
schema:
|
application/json:
|
||||||
type: array
|
schema:
|
||||||
items:
|
type: array
|
||||||
$ref: '../objects/Folder.yaml#/components/schemas/folder'
|
items:
|
||||||
|
$ref: '../objects/Folder.yaml#/components/schemas/folder'
|
||||||
libraryDisplayOrder:
|
libraryDisplayOrder:
|
||||||
name: displayOrder
|
name: displayOrder
|
||||||
in: requestBody
|
in: requestBody
|
||||||
description: The display order of the library. Must be >= 1.
|
description: The display order of the library. Must be >= 1.
|
||||||
required: false
|
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
type: integer
|
||||||
minimum: 1
|
minimum: 1
|
||||||
|
|
@ -29,34 +31,35 @@ components:
|
||||||
libraryIcon:
|
libraryIcon:
|
||||||
name: icon
|
name: icon
|
||||||
in: requestBody
|
in: requestBody
|
||||||
|
summary: The icon of library.
|
||||||
description: The icon of the library. See Library Icons for a list of possible icons.
|
description: The icon of the library. See Library Icons for a list of possible icons.
|
||||||
required: false
|
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
example: 'audiobookshelf'
|
example: 'audiobookshelf'
|
||||||
libraryMediaType:
|
libraryMediaType:
|
||||||
name: mediaType
|
name: mediaType
|
||||||
in: requestBody
|
in: requestBody
|
||||||
|
summary: The type of media the library contains.
|
||||||
description: The type of media that the library contains. Must be `book` or `podcast`.
|
description: The type of media that the library contains. Must be `book` or `podcast`.
|
||||||
required: false
|
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
example: 'book'
|
example: 'book'
|
||||||
libraryProvider:
|
libraryProvider:
|
||||||
name: provider
|
name: provider
|
||||||
in: requestBody
|
in: requestBody
|
||||||
|
summary: Preferred metadata provider for the library.
|
||||||
description: Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.
|
description: Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.
|
||||||
required: false
|
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
example: 'audible'
|
example: 'audible'
|
||||||
librarySettings:
|
librarySettings:
|
||||||
name: settings
|
name: settings
|
||||||
in: requestBody
|
in: requestBody
|
||||||
|
summary: The settings for the library.
|
||||||
description: The settings for the library.
|
description: The settings for the library.
|
||||||
required: false
|
|
||||||
schema:
|
schema:
|
||||||
$ref: '../objects/Library.yaml#/components/schemas/librarySettings'
|
$ref: '../objects/Library.yaml#/components/schemas/librarySettings'
|
||||||
|
parameters:
|
||||||
libraryId:
|
libraryId:
|
||||||
name: id
|
name: id
|
||||||
in: path
|
in: path
|
||||||
|
|
@ -66,13 +69,6 @@ components:
|
||||||
type: string
|
type: string
|
||||||
format: uuid
|
format: uuid
|
||||||
example: e4bb1afb-4a4f-4dd6-8be0-e615d233185b
|
example: e4bb1afb-4a4f-4dd6-8be0-e615d233185b
|
||||||
librarySettings:
|
|
||||||
name: settings
|
|
||||||
in: requestBody
|
|
||||||
description: The settings for the library.
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
$ref: '../objects/Library.yaml#/components/schemas/librarySettings'
|
|
||||||
responses:
|
responses:
|
||||||
library200:
|
library200:
|
||||||
description: Library found.
|
description: Library found.
|
||||||
|
|
@ -87,3 +83,88 @@ components:
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
example: Library not found.
|
example: Library not found.
|
||||||
|
paths:
|
||||||
|
/api/libraries:
|
||||||
|
get:
|
||||||
|
operationId: getLibraries
|
||||||
|
summary: Get all libraries on server
|
||||||
|
description: Get all libraries on server.
|
||||||
|
tags:
|
||||||
|
- Libraries
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: getLibraries OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '../objects/Library.yaml#/components/schemas/library'
|
||||||
|
post:
|
||||||
|
operationId: createLibrary
|
||||||
|
summary: Create a new library on server
|
||||||
|
description: Create a new library on server.
|
||||||
|
tags:
|
||||||
|
- Libraries
|
||||||
|
requestBody:
|
||||||
|
$ref: '#/components/requestBody/libraryName'
|
||||||
|
$ref: '#/components/requestBody/libraryFolders'
|
||||||
|
$ref: '#/components/requestBody/libraryDisplayOrder'
|
||||||
|
$ref: '#/components/requestBody/libraryIcon'
|
||||||
|
$ref: '#/components/requestBody/libraryMediaType'
|
||||||
|
$ref: '#/components/requestBody/libraryProvider'
|
||||||
|
$ref: '#/components/requestBody/librarySettings'
|
||||||
|
required: [name, folders]
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
$ref: '#/components/responses/library200'
|
||||||
|
'404':
|
||||||
|
$ref: '#/components/responses/library404'
|
||||||
|
/api/libraries/{id}:
|
||||||
|
get:
|
||||||
|
operationId: getLibraryById
|
||||||
|
summary: Get a single library by ID on server
|
||||||
|
description: Get a single library by ID on server.
|
||||||
|
tags:
|
||||||
|
- Libraries
|
||||||
|
parameters:
|
||||||
|
$ref: '#/components/parameters/libraryId'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
$ref: '#/components/responses/library200'
|
||||||
|
'404':
|
||||||
|
$ref: '#/components/responses/library404'
|
||||||
|
patch:
|
||||||
|
operationId: updateLibraryById
|
||||||
|
summary: Update a single library by ID on server
|
||||||
|
description: Update a single library by ID on server.
|
||||||
|
tags:
|
||||||
|
- Libraries
|
||||||
|
parameters:
|
||||||
|
$ref: '#/components/parameters/libraryId'
|
||||||
|
requestBody:
|
||||||
|
$ref: '#/components/requestBody/libraryName'
|
||||||
|
$ref: '#/components/requestBody/libraryFolders'
|
||||||
|
$ref: '#/components/requestBody/libraryDisplayOrder'
|
||||||
|
$ref: '#/components/requestBody/libraryIcon'
|
||||||
|
$ref: '#/components/requestBody/libraryMediaType'
|
||||||
|
$ref: '#/components/requestBody/libraryProvider'
|
||||||
|
$ref: '#/components/requestBody/librarySettings'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
$ref: '#/components/responses/library200'
|
||||||
|
'404':
|
||||||
|
$ref: '#/components/responses/library404'
|
||||||
|
delete:
|
||||||
|
operationId: deleteLibraryById
|
||||||
|
summary: Delete a single library by ID on server
|
||||||
|
description: Delete a single library by ID on server and return the deleted object.
|
||||||
|
tags:
|
||||||
|
- Libraries
|
||||||
|
parameters:
|
||||||
|
$ref: '#/components/parameters/libraryId'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
$ref: '#/components/responses/library200'
|
||||||
|
'404':
|
||||||
|
$ref: '#/components/responses/library404'
|
||||||
|
|
|
||||||
|
|
@ -161,85 +161,9 @@ paths:
|
||||||
'404':
|
'404':
|
||||||
$ref: './controllers/AuthorController.yaml#/components/responses/author404'
|
$ref: './controllers/AuthorController.yaml#/components/responses/author404'
|
||||||
/api/libraries:
|
/api/libraries:
|
||||||
get:
|
$ref: './controllers/LibraryController.yaml#/paths/~1api~1libraries'
|
||||||
operationId: getLibraries
|
|
||||||
summary: Get all libraries on server
|
|
||||||
description: Get all libraries on server.
|
|
||||||
tags:
|
|
||||||
- Libraries
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: getLibraries OK
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: './objects/Library.yaml#/components/schemas/library'
|
|
||||||
post:
|
|
||||||
operationId: createLibrary
|
|
||||||
summary: Create a new library on server
|
|
||||||
description: Create a new library 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/libraryIcon'
|
|
||||||
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryMediaType'
|
|
||||||
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryProvider'
|
|
||||||
- $ref: './controllers/LibraryController.yaml#/components/parameters/librarySettings'
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library200'
|
|
||||||
'400':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library404'
|
|
||||||
/api/libraries/{id}:
|
/api/libraries/{id}:
|
||||||
get:
|
$ref: './controllers/LibraryController.yaml#/paths/~1api~1libraries~1{id}'
|
||||||
operationId: getLibraryById
|
|
||||||
summary: Get a single library by ID on server
|
|
||||||
description: Get a single library by ID on server.
|
|
||||||
tags:
|
|
||||||
- Libraries
|
|
||||||
parameters:
|
|
||||||
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryId'
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library200'
|
|
||||||
'404':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library404'
|
|
||||||
patch:
|
|
||||||
operationId: updateLibraryById
|
|
||||||
summary: Update a single library by ID on server
|
|
||||||
description: Update a single library by ID on server.
|
|
||||||
tags:
|
|
||||||
- Libraries
|
|
||||||
parameters:
|
|
||||||
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryId'
|
|
||||||
- $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':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library200'
|
|
||||||
'404':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library404'
|
|
||||||
delete:
|
|
||||||
operationId: deleteLibraryById
|
|
||||||
summary: Delete a single library by ID on server
|
|
||||||
description: Delete a single library by ID on server and return the deleted object.
|
|
||||||
tags:
|
|
||||||
- Libraries
|
|
||||||
parameters:
|
|
||||||
- $ref: './controllers/LibraryController.yaml#/components/parameters/libraryId'
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library200'
|
|
||||||
'404':
|
|
||||||
$ref: './controllers/LibraryController.yaml#/components/responses/library404'
|
|
||||||
tags:
|
tags:
|
||||||
- name: Authors
|
- name: Authors
|
||||||
description: Author endpoints
|
description: Author endpoints
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue