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

WIP: feat: add more OpenAPI specs #3198

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
Added some smaller fixes and the getaitem endpoint
Vito0912 committed Jul 28, 2024
commit 7ae904ccbba7c8a667368bf2f9385170861b003e
2 changes: 2 additions & 0 deletions docs/controllers/AuthController.yaml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ paths:
post:
summary: Login to the server
description: Logs in a client to the server, returning information about the user and server.
operationId: login
requestBody:
required: true
content:
@@ -38,6 +39,7 @@ paths:
post:
summary: Logout from the server
description: Logs out a client from the server. If the socketId parameter is provided, the server removes the socket from the client list.
operationId: logout
requestBody:
required: true
content:
1 change: 1 addition & 0 deletions docs/controllers/LibraryController.yaml
Original file line number Diff line number Diff line change
@@ -167,6 +167,7 @@ paths:
parameters:
- in: query
name: include
description: A comma separated list of what to include with the library item. The only current option is filterdata.
schema:
type: string
- $ref: '../schemas.yaml#/components/parameters/minified'
41 changes: 41 additions & 0 deletions docs/controllers/LibraryItemController.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
paths:
/api/items/{id}:
parameters:
- name: id
in: path
description: The ID of the library item.
required: true
schema:
$ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItemId'
get:
operationId: getLibraryItem
summary: Get a single library item by ID on server.
description: Get a single library item by ID on server.
tags:
- LibraryItem
parameters:
- in: query
name: include
description: A comma separated list of what to include with the library item. The options are progress, rssfeed, authors (for books), and downloads (for podcasts). expanded must be 1 for include to have an effect.
schema:
type: string
- in: query
name: expanded
description: Whether to return Library Item Expanded instead. 0 for false, 1 for true.
schema:
type: integer
example: 1
- in: query
name: episode
description: If requesting progress for a podcast, the episode ID to get progress for.
schema:
$ref: '../objects/mediaTypes/Podcast.yaml#/components/schemas/podcastId'
responses:
'200':
description: OK
content:
application/json:
schema:
oneOf:
- $ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItemMinified'
- $ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItemBase'
4 changes: 1 addition & 3 deletions docs/objects/LibraryItem.yaml
Original file line number Diff line number Diff line change
@@ -56,9 +56,7 @@ components:
mediaType:
$ref: './mediaTypes/media.yaml#/components/schemas/mediaType'
media:
oneOf:
- $ref: './mediaTypes/Book.yaml#/components/schemas/bookMinified'
- $ref: './mediaTypes/Podcast.yaml#/components/schemas/Podcast'
$ref: './mediaTypes/Book.yaml#/components/schemas/bookMinified'
libraryItemMinified:
type: object
description: A single item on the server, like a book or podcast. Minified media format.
2 changes: 2 additions & 0 deletions docs/objects/mediaTypes/Book.yaml
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ components:
type: object
description: Base book schema
properties:
id:
description: TODO
libraryItemId:
$ref: '../LibraryItem.yaml#/components/schemas/libraryItemId'
coverPath:
Binary file modified docs/openapi.json
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/root.yaml
Original file line number Diff line number Diff line change
@@ -81,6 +81,8 @@ paths:
$ref: './controllers/AuthController.yaml#/paths/~1login'
/logout:
$ref: './controllers/AuthController.yaml#/paths/~1logout'
/api/items/{id}:
$ref: './controllers/LibraryItemController.yaml#/paths/~1api~1items~1{id}'
tags:
- name: Authors
description: Author endpoints