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

@ -26,6 +26,30 @@ class LibraryItemController {
* @param {import('express').Request} req
* @param {import('express').Response} res
*/
/**
* @openapi
* /api/items/{id}:
* get:
* summary: Get a library item
* tags:
* - Items
* parameters:
* - name: id
* in: path
* description: Library Item ID
* required: true
* schema:
* type: string
* responses:
* 200:
* description: Got the library item
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/libraryItem'
* 400:
* description: Invalid collection data
*/
async findOne(req, res) {
const includeEntities = (req.query.include || '').split(',')
if (req.query.expanded == 1) {