Update: some library parameters

This commit is contained in:
Nicholas Wallace 2024-06-21 20:03:47 +00:00
parent 86cb5049ee
commit faa31471b4
3 changed files with 278 additions and 204 deletions

View file

@ -57,6 +57,32 @@ components:
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`.
type: string type: string
example: 'rssfeed' example: 'rssfeed'
parameters:
limit:
in: query
name: limit
description: The number of items to return. This the size of a single page for the optional `page` query.
example: 10
schema:
type: integer
default: 0
page:
in: query
name: page
description: The page number (zero indexed) to return. If no limit is specified, then page will have no effect.
example: 0
schema:
type: integer
default: 0
desc:
in: query
name: desc
description: Return items in reversed order if true.
example: true
schema:
type: boolean
default: false
responses: responses:
library200: library200:
description: Library found. description: Library found.
@ -135,6 +161,11 @@ paths:
description: Get a single library by ID on server. description: Get a single library by ID on server.
tags: tags:
- Libraries - Libraries
parameters:
- in: query
name: include
schema:
type: string
responses: responses:
'200': '200':
$ref: '#/components/responses/library200' $ref: '#/components/responses/library200'
@ -222,30 +253,38 @@ paths:
description: Get items in a library by ID on server. description: Get items in a library by ID on server.
tags: tags:
- Libraries - Libraries
requestBody: parameters:
required: false - $ref: '#/components/parameters/limit'
description: The filters to apply to the requested library items. - $ref: '#/components/parameters/page'
content: - in: query
application/json: name: sort
description: The field to sort by from the request.
example: 'numBooks'
schema: schema:
type: object type: string
properties: enum: ['name', 'numBooks', 'totalDuration', 'addedAt', 'lastBookAdded', 'lastBookUpdated']
limit: default: 'name'
$ref: '../schemas.yaml#/components/schemas/limit' - $ref: '#/components/parameters/desc'
page: - in: query
$ref: '../schemas.yaml#/components/schemas/page' name: filter
sort: description: The filter for the library.
$ref: '#/components/schemas/librarySort' example: 'media.metadata.title'
desc: schema:
$ref: '../schemas.yaml#/components/schemas/sortDesc' type: string
filter: - in: query
$ref: '#/components/schemas/libraryFilter' name: include
minified: description: The fields to include in the response. The only current option is `rssfeed`.
$ref: '../schemas.yaml#/components/schemas/minified' allowReserved: true
collapseSeries: example: 'rssfeed'
$ref: '#/components/schemas/libraryCollapseSeries' schema:
include: type: string
$ref: '#/components/schemas/libraryInclude' - $ref: '../schemas.yaml#/components/parameters/minified'
- in: query
name: collapseSeries
description: Whether to collapse series into a single cover
schema:
type: integer
default: 0
responses: responses:
'200': '200':
description: getLibraryItems OK description: getLibraryItems OK
@ -323,20 +362,8 @@ paths:
tags: tags:
- Libraries - Libraries
parameters: parameters:
- in: query - $ref: '#/components/parameters/limit'
name: limit - $ref: '#/components/parameters/page'
description: The number of series to return. If 0, all series are returned.
example: 10
schema:
type: integer
default: 0
- in: query
name: page
description: The page number (zero indexed) to return. If no limit is specified, then page will have no effect.
example: 0
schema:
type: integer
default: 0
- in: query - in: query
name: sort name: sort
description: The field to sort by from the request. description: The field to sort by from the request.
@ -345,13 +372,7 @@ paths:
type: string type: string
enum: ['name', 'numBooks', 'totalDuration', 'addedAt', 'lastBookAdded', 'lastBookUpdated'] enum: ['name', 'numBooks', 'totalDuration', 'addedAt', 'lastBookAdded', 'lastBookUpdated']
default: 'name' default: 'name'
- in: query - $ref: '#/components/parameters/desc'
name: desc
description: Return items in reversed order if true.
example: true
schema:
type: boolean
default: false
- in: query - in: query
name: filter name: filter
description: The filter for the library. description: The filter for the library.
@ -361,6 +382,7 @@ paths:
- in: query - in: query
name: include name: include
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`.
allowReserved: true
example: 'rssfeed' example: 'rssfeed'
schema: schema:
type: string type: string
@ -416,32 +438,32 @@ paths:
deprecated: true deprecated: true
tags: tags:
- Libraries - Libraries
requestBody: parameters:
required: false - $ref: '#/components/parameters/limit'
description: The filters to apply to the requested library series. - $ref: '#/components/parameters/page'
content: - in: query
application/json: name: sort
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. description: The field to sort by from the request.
example: 'numBooks'
schema:
type: string type: string
enum: ['name', 'numBooks', 'totalDuration', 'addedAt', 'lastBookAdded', 'lastBookUpdated'] enum: ['name', 'numBooks', 'totalDuration', 'addedAt', 'lastBookAdded', 'lastBookUpdated']
example: 'numBooks'
default: 'name' default: 'name'
desc: - $ref: '#/components/parameters/desc'
$ref: '../schemas.yaml#/components/schemas/sortDesc' - in: query
filter: name: filter
$ref: '#/components/schemas/libraryFilter' description: The filter for the library.
minified: example: 'media.metadata.title'
$ref: '../schemas.yaml#/components/schemas/minified' schema:
include: type: string
$ref: '#/components/schemas/libraryInclude' - $ref: '../schemas.yaml#/components/parameters/minified'
- in: query
name: include
description: The fields to include in the response. The only current option is `rssfeed`.
allowReserved: true
example: 'rssfeed'
schema:
type: string
responses: responses:
'200': '200':
description: getLibrarySeriesById OK description: getLibrarySeriesById OK

View file

@ -492,6 +492,15 @@
"tags": [ "tags": [
"Libraries" "Libraries"
], ],
"parameters": [
{
"in": "query",
"name": "include",
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"$ref": "#/components/responses/library200" "$ref": "#/components/responses/library200"
@ -631,43 +640,66 @@
"tags": [ "tags": [
"Libraries" "Libraries"
], ],
"requestBody": { "parameters": [
"required": false, {
"description": "The filters to apply to the requested library items.", "$ref": "#/components/parameters/limit"
"content": { },
"application/json": { {
"$ref": "#/components/parameters/page"
},
{
"in": "query",
"name": "sort",
"description": "The field to sort by from the request.",
"example": "numBooks",
"schema": { "schema": {
"type": "object", "type": "string",
"properties": { "enum": [
"limit": { "name",
"$ref": "#/components/schemas/limit" "numBooks",
}, "totalDuration",
"page": { "addedAt",
"$ref": "#/components/schemas/page" "lastBookAdded",
}, "lastBookUpdated"
"sort": { ],
"$ref": "#/components/schemas/librarySort" "default": "name"
},
"desc": {
"$ref": "#/components/schemas/sortDesc"
},
"filter": {
"$ref": "#/components/schemas/libraryFilter"
},
"minified": {
"$ref": "#/components/schemas/minified"
},
"collapseSeries": {
"$ref": "#/components/schemas/libraryCollapseSeries"
},
"include": {
"$ref": "#/components/schemas/libraryInclude"
}
}
}
}
} }
}, },
{
"$ref": "#/components/parameters/desc"
},
{
"in": "query",
"name": "filter",
"description": "The filter for the library.",
"example": "media.metadata.title",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "include",
"description": "The fields to include in the response. The only current option is `rssfeed`.",
"allowReserved": true,
"example": "rssfeed",
"schema": {
"type": "string"
}
},
{
"$ref": "#/components/parameters/minified"
},
{
"in": "query",
"name": "collapseSeries",
"description": "Whether to collapse series into a single cover",
"schema": {
"type": "integer",
"default": 0
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "getLibraryItems OK", "description": "getLibraryItems OK",
@ -781,24 +813,10 @@
], ],
"parameters": [ "parameters": [
{ {
"in": "query", "$ref": "#/components/parameters/limit"
"name": "limit",
"description": "The number of series to return. If 0, all series are returned.",
"example": 10,
"schema": {
"type": "integer",
"default": 0
}
}, },
{ {
"in": "query", "$ref": "#/components/parameters/page"
"name": "page",
"description": "The page number (zero indexed) to return. If no limit is specified, then page will have no effect.",
"example": 0,
"schema": {
"type": "integer",
"default": 0
}
}, },
{ {
"in": "query", "in": "query",
@ -819,14 +837,7 @@
} }
}, },
{ {
"in": "query", "$ref": "#/components/parameters/desc"
"name": "desc",
"description": "Return items in reversed order if true.",
"example": true,
"schema": {
"type": "boolean",
"default": false
}
}, },
{ {
"in": "query", "in": "query",
@ -841,6 +852,7 @@
"in": "query", "in": "query",
"name": "include", "name": "include",
"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`.",
"allowReserved": true,
"example": "rssfeed", "example": "rssfeed",
"schema": { "schema": {
"type": "string" "type": "string"
@ -925,22 +937,19 @@
"tags": [ "tags": [
"Libraries" "Libraries"
], ],
"requestBody": { "parameters": [
"required": false, {
"description": "The filters to apply to the requested library series.", "$ref": "#/components/parameters/limit"
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"limit": {
"$ref": "#/components/schemas/limit"
}, },
"page": { {
"$ref": "#/components/schemas/page" "$ref": "#/components/parameters/page"
}, },
"sort": { {
"in": "query",
"name": "sort",
"description": "The field to sort by from the request.", "description": "The field to sort by from the request.",
"example": "numBooks",
"schema": {
"type": "string", "type": "string",
"enum": [ "enum": [
"name", "name",
@ -950,26 +959,35 @@
"lastBookAdded", "lastBookAdded",
"lastBookUpdated" "lastBookUpdated"
], ],
"example": "numBooks",
"default": "name" "default": "name"
},
"desc": {
"$ref": "#/components/schemas/sortDesc"
},
"filter": {
"$ref": "#/components/schemas/libraryFilter"
},
"minified": {
"$ref": "#/components/schemas/minified"
},
"include": {
"$ref": "#/components/schemas/libraryInclude"
}
}
}
}
} }
}, },
{
"$ref": "#/components/parameters/desc"
},
{
"in": "query",
"name": "filter",
"description": "The filter for the library.",
"example": "media.metadata.title",
"schema": {
"type": "string"
}
},
{
"$ref": "#/components/parameters/minified"
},
{
"in": "query",
"name": "include",
"description": "The fields to include in the response. The only current option is `rssfeed`.",
"allowReserved": true,
"example": "rssfeed",
"schema": {
"type": "string"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "getLibrarySeriesById OK", "description": "getLibrarySeriesById OK",
@ -1766,6 +1784,11 @@
} }
] ]
}, },
"total": {
"description": "The total number of items in the response.",
"type": "integer",
"example": 100
},
"limit": { "limit": {
"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.",
"type": "integer", "type": "integer",
@ -1778,20 +1801,19 @@
"example": 1, "example": 1,
"default": 0 "default": 0
}, },
"librarySort": { "sortBy": {
"description": "The sort order of the library. For example, to sort by title use 'sort=media.metadata.title'.",
"type": "string", "type": "string",
"description": "The field to sort by from the request.",
"example": "media.metadata.title" "example": "media.metadata.title"
}, },
"sortDesc": { "sortDesc": {
"description": "Return items in reversed order if true.", "description": "Whether to sort in descending order.",
"type": "boolean", "type": "boolean",
"example": true, "example": true
"default": false
}, },
"libraryFilter": { "filterBy": {
"description": "The filter for the library.",
"type": "string", "type": "string",
"description": "The field to filter by from the request. TODO",
"example": "media.metadata.title" "example": "media.metadata.title"
}, },
"minified": { "minified": {
@ -1800,37 +1822,16 @@
"example": true, "example": true,
"default": false "default": false
}, },
"libraryCollapseSeries": { "collapseSeries": {
"description": "Whether to collapse series.",
"type": "boolean", "type": "boolean",
"example": true, "description": "Whether collapse series was set in the request.",
"default": false "example": true
}, },
"libraryInclude": { "libraryInclude": {
"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`.",
"type": "string", "type": "string",
"example": "rssfeed" "example": "rssfeed"
}, },
"total": {
"description": "The total number of items in the response.",
"type": "integer",
"example": 100
},
"sortBy": {
"type": "string",
"description": "The field to sort by from the request.",
"example": "media.metadata.title"
},
"filterBy": {
"type": "string",
"description": "The field to filter by from the request. TODO",
"example": "media.metadata.title"
},
"collapseSeries": {
"type": "boolean",
"description": "Whether collapse series was set in the request.",
"example": true
},
"sequence": { "sequence": {
"description": "The position in the series the book is.", "description": "The position in the series the book is.",
"type": "string", "type": "string",
@ -2004,6 +2005,48 @@
} }
} }
} }
},
"parameters": {
"limit": {
"in": "query",
"name": "limit",
"description": "The number of items to return. This the size of a single page for the optional `page` query.",
"example": 10,
"schema": {
"type": "integer",
"default": 0
}
},
"page": {
"in": "query",
"name": "page",
"description": "The page number (zero indexed) to return. If no limit is specified, then page will have no effect.",
"example": 0,
"schema": {
"type": "integer",
"default": 0
}
},
"desc": {
"in": "query",
"name": "desc",
"description": "Return items in reversed order if true.",
"example": true,
"schema": {
"type": "boolean",
"default": false
}
},
"minified": {
"in": "query",
"name": "minified",
"description": "Return minified items if true",
"schema": {
"type": "integer",
"minimum": 0,
"example": 1
}
}
} }
} }
} }

View file

@ -60,3 +60,12 @@ components:
type: string type: string
example: 'us' example: 'us'
default: 'us' default: 'us'
parameters:
minified:
in: query
name: minified
description: Return minified items if true
schema:
type: integer
minimum: 0
example: 1