Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial library endpoints #3012

Merged
merged 49 commits into from
Jun 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7da2d0a
Fix: extra type in `Author.yaml`
nichwall May 6, 2024
76100b6
Fix: formatting
nichwall May 6, 2024
5fdfc9e
Initial library schema
nichwall May 6, 2024
5295088
Additional debugging
nichwall May 9, 2024
242afb3
Fix: spec relative paths
nichwall May 12, 2024
f92f5c3
Add: ebook file spec
nichwall May 12, 2024
a0a2fef
Fix: response type should be string
nichwall May 12, 2024
d6407cf
Linting updates
nichwall May 12, 2024
1b3882b
Add: missing librarySettings
nichwall May 12, 2024
39f2d7d
Temporary fix: Library cron can be null or false
nichwall May 12, 2024
8c85092
Author controller updates
nichwall May 12, 2024
2621d04
Add: `/api/libraries/{id}` endpoint
nichwall May 12, 2024
9f6ef2d
Update library responses
nichwall May 12, 2024
eaad5c8
Add: descriptions
nichwall May 12, 2024
d5ecf36
Fix: queries should be in body
nichwall May 12, 2024
5795d01
Fix: `body` should be `requestBody`
nichwall May 12, 2024
535e88f
Move: `libraryController` paths, clean up `requestBody`
nichwall May 12, 2024
8239422
Clean up libraryController parameters
nichwall May 14, 2024
c8c2584
Move: author endpoints to controller
nichwall May 14, 2024
8c2073c
Add `get` for author images
nichwall May 14, 2024
bda3e62
Simplify author schema with items
nichwall May 14, 2024
44a98a0
Remove: unused response type
nichwall May 14, 2024
a60f746
Update: formatting
nichwall May 14, 2024
9af5b8d
Update json
nichwall May 14, 2024
0e9cf0d
Update requestBody on LibraryController
nichwall May 15, 2024
1430946
LibrarySettings update
nichwall May 15, 2024
e8797ce
Replace: generic parameter with path specific parameter
nichwall May 15, 2024
88ef453
Fix: requestBody descriptions
nichwall May 15, 2024
771895d
Fix: match post operation
nichwall May 17, 2024
0cadb99
Temporary: nullable Author schemas
nichwall May 17, 2024
d85ed0c
LibraryController items endpoint
nichwall May 17, 2024
a0e915d
Add: delete library items with issues
nichwall May 17, 2024
44deef3
Massive cleanup and violation fixing
nichwall May 18, 2024
df03343
Update bundled spec
nichwall May 18, 2024
2ff0cb2
Add: remove library items with issues
nichwall May 18, 2024
955f6ff
Add: library items endpoint
nichwall May 18, 2024
802e14a
Fix: errors
nichwall May 18, 2024
b61c38b
Fix: base schemas
nichwall May 18, 2024
78e8421
Add: series schemas
nichwall May 18, 2024
1068a68
Add: library series endpoint
nichwall May 19, 2024
f32ef3d
Fix: oneOf and array issues
nichwall May 19, 2024
37d029e
Add: author search region for matching
nichwall May 19, 2024
6a9f4db
Add: series endpoints
nichwall May 20, 2024
8c40fa5
Fix: series issues
nichwall May 20, 2024
d293edf
Add library series endpoint and update deprecation
nichwall May 20, 2024
bc14921
Fix: series endpoint deprecation
nichwall May 21, 2024
c5f82e1
Fix: `name` in `sortDesc` schema
nichwall May 25, 2024
a7a68a0
Add: workflow for linting spec
nichwall May 25, 2024
e17cf99
Update OpenAPI readme
nichwall May 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
LibraryController items endpoint
nichwall committed May 17, 2024
commit d85ed0cc32551f0b2ec8af08850e9aa50cd86eb5
113 changes: 113 additions & 0 deletions docs/controllers/LibraryController.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
components:
schemas:
sortBy:
type: string
description: The field to sort by from the request.
example: 'media.metadata.title'
sortDesc:
name: sortDesc
description: Whether to sort in descending order.
type: boolean
example: true
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
libraryInclude:
type: string
description: The fields from the response.
example: 'rssfeed'
requestBody:
libraryName:
name: name
@@ -59,6 +81,37 @@ components:
description: The settings for the library.
schema:
$ref: '../objects/Library.yaml#/components/schemas/librarySettings'
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'.
schema:
type: string
example: 'media.metadata.title'
libraryFilter:
name: filter
in: requestBody
summary: The filter for the library. TODO
description: The filter for the library.
schema:
type: string
example: 'media.metadata.title'
libraryCollapseSeries:
name: collapseSeries
in: requestBody
description: Whether to collapse series.
schema:
type: boolean
example: true
default: false
libraryInclude:
name: include
in: requestBody
description: The fields to include in the response. The only current option is `rssfeed`.
schema:
type: string
example: 'rssfeed'
responses:
library200:
description: Library found.
@@ -187,3 +240,63 @@ paths:
$ref: '#/components/responses/library200'
'404':
$ref: '#/components/responses/library404'
/api/libraries/{id}/items:
parameters:
- name: id
in: path
description: The ID of the library.
required: true
schema:
$ref: '../objects/Library.yaml#/components/schemas/libraryId'
get:
operationId: getLibraryItems
summary: Get all items in a library by ID on server
description: Get all items in a library by ID on server.
tags:
- Libraries
requestBody:
required: false
description: The filters to apply to the requested library items.
content:
application/json:
schema:
type: object
properties:
limit:
$ref: '../schemas.yaml#/components/requestBody/limit'
page:
$ref: '../schemas.yaml#/components/requestBody/page'
sort:
$ref: '#/components/requestBody/librarySort'
desc:
$ref: '../schemas.yaml#/components/requestBody/sortDesc'
filter:
$ref: '#/components/requestBody/libraryFilter'
minified:
$ref: '../schemas.yaml#/components/requestBody/minified'
collapseSeries:
$ref: '#/components/requestBody/libraryCollapseSeries'
include:
$ref: '#/components/requestBody/libraryInclude'
responses:
'200':
description: getLibraryItems OK
content:
application/json:
schema:
oneOf:
- type: array
items:
$ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItem'
- $ref: '../schemas.yaml#/components/schemas/total'
- $ref: '../schemas.yaml#/components/schemas/limit'
- $ref: '../schemas.yaml#/components/schemas/page'
- $ref: '#/components/schemas/sortBy'
- $ref: '#/components/schemas/sortDesc'
- $ref: '#/components/schemas/filterBy'
- $ref: '../objects/mediaTypes/media.yaml#/components/schemas/mediaType'
- $ref: '../schemas.yaml#/components/schemas/minified'
- $ref: '#/components/schemas/collapseSeries'
- $ref: '#/components/schemas/libraryInclude'
'404':
$ref: '#/components/responses/library404'
53 changes: 53 additions & 0 deletions docs/schemas.yaml
Original file line number Diff line number Diff line change
@@ -31,3 +31,56 @@ components:
type: string
format: '[0-9]*'
example: '649644248522215260'
limit:
description: The number of items to return from the request.
type: integer
example: 10
total:
description: The total number of items in the response.
type: integer
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:
name: limit
in: requestBody
summary: The number of items to return.
description: The number of items to return. If 0, no items are returned.
schema:
type: integer
example: 10
default: 0
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.
schema:
type: integer
example: 1
default: 0
sortDesc:
name: desc
in: requestBody
summary: Sort in reverse order.
description: Return items in reversed order if true.
schema:
type: boolean
example: true
default: false
minified:
name: minified
in: requestBody
summary: Return minified items.
description: Return minified items if true.
schema:
type: boolean
example: true
default: false