Initial CollectionController OpenAPI spec

This includes a large `components.js` taken from initial efforts of
benonymity. This file still needs to be cleaned up but is provided
as a starting point.
This commit is contained in:
Nicholas Wallace 2024-02-17 03:50:37 +00:00
parent 4c11ca5a55
commit f41b1b6469
5 changed files with 4105 additions and 11 deletions

View file

@ -451,6 +451,31 @@ class LibraryController {
* @param {*} req
* @param {*} res
*/
/**
* @openapi
* /api/libraries/{id}/collections:
* get:
* operationId: getLibraryCollections
* summary: Get all collections in a library
* tags:
* - Library
* parameters:
* - name: id
* in: path
* description: Library ID
* required: true
* schema:
* type: string
* responses:
* 200:
* description: Collection created successfully
* content:
* application/json:
* schema:
* type: array
* items:
* $ref: '#/components/schemas/collectionExpanded'
*/
async getCollectionsForLibrary(req, res) {
const include = (req.query.include || '').split(',').map(v => v.trim().toLowerCase()).filter(v => !!v)