Massive cleanup and violation fixing

This commit is contained in:
Nicholas Wallace 2024-05-18 22:25:52 +00:00
parent a0e915db17
commit 44deef3453
5 changed files with 99 additions and 265 deletions

View file

@ -8,115 +8,43 @@ components:
description: Whether the author was merged with another author. Will not exist if author was updated. description: Whether the author was merged with another author. Will not exist if author was updated.
type: boolean type: boolean
nullable: true nullable: true
requestBody:
asin:
name: asin
in: requestBody
description: The Audible Identifier (ASIN).
schema:
$ref: '../objects/entities/Author.yaml#/components/schemas/authorAsin'
authorDescription:
name: description
in: requestBody
description: The new description of the author.
schema:
type: string
nullable: true
example: Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork, The Sword of Truth. He has written 30+ major, bestselling novels, has been published in more than 20 languages world-wide, and has sold more than 26 Million books. The Sword of Truth is a revered literary tour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing.
authorInclude: authorInclude:
name: include description: A comma separated list of what to include with the author. The options are `items` and `series`. `series` will only have an effect if `items` is included. For example, the value `items,series` will include both library items and series.
in: requestBody type: string
description: A comma separated list of what to include with the author. The options are `items` and `series`. `series` will only have an effect if `items` is included. example: 'items'
schema:
type: string
example: 'items'
examples:
empty:
summary: Do not return library items
value: ''
itemOnly:
summary: Only return library items
value: 'items'
itemsAndSeries:
summary: Return library items and series
value: 'items,series'
authorLibraryId: authorLibraryId:
name: library $ref: '../objects/Library.yaml#/components/schemas/libraryId'
in: requestBody
description: The ID of the library to to include filter included items from.
schema:
$ref: '../objects/Library.yaml#/components/schemas/libraryId'
authorSearchName: authorSearchName:
name: q
in: requestBody
description: The name of the author to use for searching. description: The name of the author to use for searching.
schema: type: string
type: string example: Terry Goodkind
example: Terry Goodkind
authorName: authorName:
name: name $ref: '../objects/entities/Author.yaml#/components/schemas/authorName'
in: requestBody
description: The new name of the author.
schema:
$ref: '../objects/entities/Author.yaml#/components/schemas/authorName'
authorImagePath:
name: imagePath
in: requestBody
description: The new absolute path for the author image.
required: false
schema:
type: string
nullable: true
example: /metadata/authors/aut_z3leimgybl7uf3y4ab.jpg
imageUrl: imageUrl:
name: url
in: requestBody
description: The URL of the image to add to the server description: The URL of the image to add to the server
required: true type: string
schema: format: uri
type: string example: https://images-na.ssl-images-amazon.com/images/I/51NoQTm33OL.__01_SX120_CR0,0,120,120__.jpg
format: uri
example: https://images-na.ssl-images-amazon.com/images/I/51NoQTm33OL.__01_SX120_CR0,0,120,120__.jpg
imageWidth: imageWidth:
name: width
in: requestBody
description: The requested width of image in pixels. description: The requested width of image in pixels.
schema: type: integer
type: integer default: 400
default: 400
example: 400
example: 400 example: 400
imageHeight: imageHeight:
name: height
in: requestBody
description: The requested height of image in pixels. If `null`, the height is scaled to maintain aspect ratio based on the requested width. description: The requested height of image in pixels. If `null`, the height is scaled to maintain aspect ratio based on the requested width.
schema: type: integer
type: integer nullable: true
nullable: true default: null
default: null example: 600
example: 600
examples:
scaleHeight:
summary: Scale height with width
value: null
fixedHeight:
summary: Force height of image
value: 600
imageFormat: imageFormat:
name: format
in: requestBody
description: The requested output format. description: The requested output format.
schema: type: string
type: string default: jpeg
default: jpeg example: webp
example: webp
imageRaw: imageRaw:
name: raw
in: requestBody
description: Return the raw image without scaling if true. description: Return the raw image without scaling if true.
schema: type: boolean
type: boolean default: false
default: false
responses: responses:
author200: author200:
description: Author found. description: Author found.
@ -154,9 +82,9 @@ paths:
schema: schema:
properties: properties:
include: include:
$ref: '#/components/requestBody/authorInclude' $ref: '#/components/schemas/authorInclude'
library: library:
$ref: '#/components/requestBody/authorLibraryId' $ref: '#/components/schemas/authorLibraryId'
responses: responses:
'200': '200':
description: getAuthorById OK description: getAuthorById OK
@ -173,20 +101,19 @@ paths:
tags: tags:
- Authors - Authors
requestBody: requestBody:
required: true
description: The author object to update. description: The author object to update.
content: content:
application/json: application/json:
schema: schema:
properties: properties:
name: name:
$ref: '#/components/requestBody/authorName' $ref: '#/components/schemas/authorName'
description: description:
$ref: '#/components/requestBody/authorDescription' $ref: '../objects/entities/Author.yaml#/components/schemas/authorDescription'
imagePath: imagePath:
$ref: '#/components/requestBody/authorImagePath' $ref: '../objects/entities/Author.yaml#/components/schemas/authorImagePath'
asin: asin:
$ref: '#/components/requestBody/asin' $ref: '../objects/entities/Author.yaml#/components/schemas/authorAsin'
responses: responses:
'200': '200':
description: updateAuthorById OK description: updateAuthorById OK
@ -237,13 +164,13 @@ paths:
schema: schema:
properties: properties:
width: width:
$ref: '#/components/requestBody/imageWidth' $ref: '#/components/schemas/imageWidth'
height: height:
$ref: '#/components/requestBody/imageHeight' $ref: '#/components/schemas/imageHeight'
format: format:
$ref: '#/components/requestBody/imageFormat' $ref: '#/components/schemas/imageFormat'
raw: raw:
$ref: '#/components/requestBody/imageRaw' $ref: '#/components/schemas/imageRaw'
responses: responses:
'200': '200':
description: getAuthorImageById OK description: getAuthorImageById OK
@ -268,15 +195,13 @@ paths:
description: Add an author image to the server. The image will be downloaded from the provided URL and stored on the server. description: Add an author image to the server. The image will be downloaded from the provided URL and stored on the server.
tags: tags:
- Authors - Authors
requestBody:
$ref: '#/components/requestBody/imageUrl'
requestBody: requestBody:
required: true required: true
description: The author image to add by URL. description: The author image to add by URL.
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/requestBody/imageUrl' $ref: '#/components/schemas/imageUrl'
responses: responses:
'200': '200':
description: addAuthorImageById OK description: addAuthorImageById OK
@ -294,20 +219,19 @@ paths:
tags: tags:
- Authors - Authors
requestBody: requestBody:
required: true
description: The author image to update. description: The author image to update.
content: content:
application/json: application/json:
schema: schema:
properties: properties:
width: width:
$ref: '#/components/requestBody/imageWidth' $ref: '#/components/schemas/imageWidth'
height: height:
$ref: '#/components/requestBody/imageHeight' $ref: '#/components/schemas/imageHeight'
format: format:
$ref: '#/components/requestBody/imageFormat' $ref: '#/components/schemas/imageFormat'
raw: raw:
$ref: '#/components/requestBody/imageRaw' $ref: '#/components/schemas/imageRaw'
responses: responses:
'200': '200':
description: updateAuthorImageById OK description: updateAuthorImageById OK
@ -350,10 +274,8 @@ paths:
application/json: application/json:
schema: schema:
oneOf: oneOf:
asin: - $ref: '../objects/entities/Author.yaml#/components/schemas/authorAsin'
$ref: '#/components/requestBody/asin' - $ref: '#/components/schemas/authorSearchName'
q:
$ref: '#/components/requestBody/authorSearchName'
responses: responses:
'200': '200':
description: matchAuthorById OK description: matchAuthorById OK

View file

@ -17,101 +17,47 @@ components:
type: boolean type: boolean
description: Whether collapse series was set in the request. description: Whether collapse series was set in the request.
example: true example: true
libraryInclude:
type: string
description: The fields from the response.
example: 'rssfeed'
requestBody:
libraryName:
name: name
in: requestBody
description: The name of the library.
content:
application/json:
schema:
type: string
example: My Audiobooks
libraryFolders: libraryFolders:
name: folders
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.
content: type: array
application/json: items:
schema: $ref: '../objects/Folder.yaml#/components/schemas/folder'
type: array
items:
$ref: '../objects/Folder.yaml#/components/schemas/folder'
libraryDisplayOrder: libraryDisplayOrder:
name: displayOrder
in: requestBody
description: The display order of the library. Must be >= 1. description: The display order of the library. Must be >= 1.
schema: type: integer
type: integer minimum: 1
minimum: 1 example: 1
example: 1
libraryIcon: libraryIcon:
name: icon
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.
schema: type: string
type: string example: 'audiobookshelf'
example: 'audiobookshelf'
libraryMediaType: libraryMediaType:
name: mediaType
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`.
schema: type: string
type: string example: 'book'
example: 'book'
libraryProvider: libraryProvider:
name: provider
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.
schema: type: string
type: string example: 'audible'
example: 'audible'
librarySettings: librarySettings:
name: settings $ref: '../objects/Library.yaml#/components/schemas/librarySettings'
in: requestBody
summary: The settings for the library.
description: The settings for the library.
schema:
$ref: '../objects/Library.yaml#/components/schemas/librarySettings'
librarySort: librarySort:
name: sort
in: requestBody
summary: The sort order of the library.
description: The sort order of the library. For example, to sort by title use 'sort=media.metadata.title'. description: The sort order of the library. For example, to sort by title use 'sort=media.metadata.title'.
schema: type: string
type: string example: 'media.metadata.title'
example: 'media.metadata.title'
libraryFilter: libraryFilter:
name: filter
in: requestBody
summary: The filter for the library. TODO
description: The filter for the library. description: The filter for the library.
schema: type: string
type: string example: 'media.metadata.title'
example: 'media.metadata.title'
libraryCollapseSeries: libraryCollapseSeries:
name: collapseSeries
in: requestBody
description: Whether to collapse series. description: Whether to collapse series.
schema: type: boolean
type: boolean example: true
example: true default: false
default: false
libraryInclude: libraryInclude:
name: include
in: requestBody
description: The fields to include in the response. The only current option is `rssfeed`. description: The fields to include in the response. The only current option is `rssfeed`.
schema: type: string
type: string example: 'rssfeed'
example: 'rssfeed'
responses: responses:
library200: library200:
description: Library found. description: Library found.
@ -147,31 +93,30 @@ paths:
operationId: createLibrary operationId: createLibrary
summary: Create a new library on server summary: Create a new library on server
description: Create a new library on server. description: Create a new library on server.
required: [name, folders]
tags: tags:
- Libraries - Libraries
requestBody: requestBody:
required: true
description: The library object to create. description: The library object to create.
content: content:
application/json: application/json:
schema: schema:
type: object type: object
required: [name, folders]
properties: properties:
name: name:
$ref: '#/components/requestBody/libraryName' $ref: '../objects/Library.yaml#/components/schemas/libraryName'
folders: folders:
$ref: '#/components/requestBody/libraryFolders' $ref: '#/components/schemas/libraryFolders'
displayOrder: displayOrder:
$ref: '#/components/requestBody/libraryDisplayOrder' $ref: '#/components/schemas/libraryDisplayOrder'
icon: icon:
$ref: '#/components/requestBody/libraryIcon' $ref: '#/components/schemas/libraryIcon'
mediaType: mediaType:
$ref: '#/components/requestBody/libraryMediaType' $ref: '#/components/schemas/libraryMediaType'
provider: provider:
$ref: '#/components/requestBody/libraryProvider' $ref: '#/components/schemas/libraryProvider'
settings: settings:
$ref: '#/components/requestBody/librarySettings' $ref: '#/components/schemas/librarySettings'
responses: responses:
'200': '200':
$ref: '#/components/responses/library200' $ref: '#/components/responses/library200'
@ -211,19 +156,19 @@ paths:
type: object type: object
properties: properties:
name: name:
$ref: '#/components/requestBody/libraryName' $ref: '../objects/Library.yaml#/components/schemas/libraryName'
folders: folders:
$ref: '#/components/requestBody/libraryFolders' $ref: '#/components/schemas/libraryFolders'
displayOrder: displayOrder:
$ref: '#/components/requestBody/libraryDisplayOrder' $ref: '#/components/schemas/libraryDisplayOrder'
icon: icon:
$ref: '#/components/requestBody/libraryIcon' $ref: '#/components/schemas/libraryIcon'
mediaType: mediaType:
$ref: '#/components/requestBody/libraryMediaType' $ref: '#/components/schemas/libraryMediaType'
provider: provider:
$ref: '#/components/requestBody/libraryProvider' $ref: '#/components/schemas/libraryProvider'
settings: settings:
$ref: '#/components/requestBody/librarySettings' $ref: '#/components/schemas/librarySettings'
responses: responses:
'200': '200':
$ref: '#/components/responses/library200' $ref: '#/components/responses/library200'
@ -263,21 +208,21 @@ paths:
type: object type: object
properties: properties:
limit: limit:
$ref: '../schemas.yaml#/components/requestBody/limit' $ref: '../schemas.yaml#/components/schemas/limit'
page: page:
$ref: '../schemas.yaml#/components/requestBody/page' $ref: '../schemas.yaml#/components/schemas/page'
sort: sort:
$ref: '#/components/requestBody/librarySort' $ref: '#/components/schemas/librarySort'
desc: desc:
$ref: '../schemas.yaml#/components/requestBody/sortDesc' $ref: '../schemas.yaml#/components/schemas/sortDesc'
filter: filter:
$ref: '#/components/requestBody/libraryFilter' $ref: '#/components/schemas/libraryFilter'
minified: minified:
$ref: '../schemas.yaml#/components/requestBody/minified' $ref: '../schemas.yaml#/components/schemas/minified'
collapseSeries: collapseSeries:
$ref: '#/components/requestBody/libraryCollapseSeries' $ref: '#/components/schemas/libraryCollapseSeries'
include: include:
$ref: '#/components/requestBody/libraryInclude' $ref: '#/components/schemas/libraryInclude'
responses: responses:
'200': '200':
description: getLibraryItems OK description: getLibraryItems OK

View file

@ -36,10 +36,8 @@ components:
example: false example: false
autoScanCronExpression: autoScanCronExpression:
description: The cron expression for when to automatically scan the library folders. If null, automatic scanning will be disabled. description: The cron expression for when to automatically scan the library folders. If null, automatic scanning will be disabled.
oneOf: type: string
- type: string nullable: true
- type: boolean
- type: null
example: '0 0 0 * * *' example: '0 0 0 * * *'
audiobooksOnly: audiobooksOnly:
description: Whether the library should ignore ebook files and only allow ebook files to be supplementary. description: Whether the library should ignore ebook files and only allow ebook files to be supplementary.

View file

@ -7,15 +7,23 @@ components:
example: e4bb1afb-4a4f-4dd6-8be0-e615d233185b example: e4bb1afb-4a4f-4dd6-8be0-e615d233185b
authorAsin: authorAsin:
description: The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier. description: The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.
oneOf: type: string
- type: string
- type: null
nullable: true nullable: true
example: B000APZOQA example: B000APZOQA
authorName: authorName:
description: The name of the author. description: The name of the author.
type: string type: string
example: Terry Goodkind example: Terry Goodkind
authorDescription:
description: The new description of the author.
type: string
nullable: true
example: Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork, The Sword of Truth. He has written 30+ major, bestselling novels, has been published in more than 20 languages world-wide, and has sold more than 26 Million books. The Sword of Truth is a revered literary tour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing.
authorImagePath:
description: The absolute path for the author image. This will be in the `metadata/` directory. Will be null if there is no image.
type: string
nullable: true
example: /metadata/authors/aut_z3leimgybl7uf3y4ab.jpg
authorSeries: authorSeries:
type: object type: object
description: Series and the included library items that an author has written. description: Series and the included library items that an author has written.
@ -28,9 +36,8 @@ components:
description: The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series. description: The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.
type: array type: array
items: items:
ref: '../LibraryItem.yaml#/components/schemas/libraryItemMinified' $ref: '../LibraryItem.yaml#/components/schemas/libraryItemMinified'
author: author:
summary: An author object which includes a description and image path.
description: An author object which includes a description and image path. The library items and series associated with the author are optionally included. description: An author object which includes a description and image path. The library items and series associated with the author are optionally included.
type: object type: object
properties: properties:
@ -41,26 +48,9 @@ components:
name: name:
$ref: '#/components/schemas/authorName' $ref: '#/components/schemas/authorName'
description: description:
description: A description of the author. Will be null if there is none. $ref: '#/components/schemas/authorDescription'
oneOf:
- type: string
- type: null
nullable: true
example: |
Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,
The Sword of Truth. He has written 30+ major, bestselling novels, has been published in more than 20
languages world-wide, and has sold more than 26 Million books. The Sword of Truth is a revered literary
tour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's
brilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind
has an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying
situations.
imagePath: imagePath:
description: The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image. $ref: '#/components/schemas/authorImagePath'
oneOf:
- type: string
- type: null
nullable: true
example: /metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg
addedAt: addedAt:
$ref: '../../schemas.yaml#/components/schemas/addedAt' $ref: '../../schemas.yaml#/components/schemas/addedAt'
updatedAt: updatedAt:

View file

@ -31,27 +31,12 @@ components:
type: string type: string
format: '[0-9]*' format: '[0-9]*'
example: '649644248522215260' example: '649644248522215260'
limit:
description: The number of items to return from the request.
type: integer
example: 10
total: total:
description: The total number of items in the response. description: The total number of items in the response.
type: integer type: integer
example: 100 example: 100
page:
description: The page number (zero indexed) to return from the request.
type: integer
example: 0
minified:
description: Whether minified was set in the request.
type: boolean
example: true
requestBody:
limit: limit:
name: limit name: limit
in: requestBody
summary: The number of items to return.
description: The number of items to return. If 0, no items are returned. description: The number of items to return. If 0, no items are returned.
schema: schema:
type: integer type: integer
@ -59,8 +44,6 @@ components:
default: 0 default: 0
page: page:
name: page name: page
in: requestBody
summary: The page number (zero indexed) to return.
description: The page number (zero indexed) to return. If no limit is specified, then page will have no effect. description: The page number (zero indexed) to return. If no limit is specified, then page will have no effect.
schema: schema:
type: integer type: integer
@ -68,8 +51,6 @@ components:
default: 0 default: 0
sortDesc: sortDesc:
name: desc name: desc
in: requestBody
summary: Sort in reverse order.
description: Return items in reversed order if true. description: Return items in reversed order if true.
schema: schema:
type: boolean type: boolean
@ -77,8 +58,6 @@ components:
default: false default: false
minified: minified:
name: minified name: minified
in: requestBody
summary: Return minified items.
description: Return minified items if true. description: Return minified items if true.
schema: schema:
type: boolean type: boolean