Simplify author schema with items

This commit is contained in:
Nicholas Wallace 2024-05-14 04:01:44 +00:00
parent 8c2073c10a
commit bda3e625f6
2 changed files with 13 additions and 29 deletions

View file

@ -158,10 +158,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: '../objects/entities/Author.yaml#/components/schemas/author'
- $ref: '../objects/entities/Author.yaml#/components/schemas/authorWithItems'
- $ref: '../objects/entities/Author.yaml#/components/schemas/authorWithSeries'
$ref: '../objects/entities/Author.yaml#/components/schemas/author'
'404':
$ref: '#/components/responses/author404'
patch:

View file

@ -28,7 +28,8 @@ components:
items:
ref: '../LibraryItem.yaml#/components/schemas/libraryItemMinified'
author:
description: An author object which includes a description and image path.
summary: An author object which includes a description and image path.
description: An author object which includes a description and image path. The library items and series associated with the author are optionally included.
type: object
properties:
id:
@ -58,25 +59,11 @@ components:
$ref: '../../schemas.yaml#/components/schemas/addedAt'
updatedAt:
$ref: '../../schemas.yaml#/components/schemas/updatedAt'
authorWithItems:
type: object
description: The author schema with an array of items they are associated with.
allOf:
- $ref: '#/components/schemas/author'
- type: object
properties:
libraryItems:
description: The items associated with the author
type: array
items:
$ref: '../LibraryItem.yaml#/components/schemas/libraryItemMinified'
authorWithSeries:
type: object
description: The author schema with an array of items and series they are associated with.
allOf:
- $ref: '#/components/schemas/authorWithItems'
- type: object
properties:
series:
description: The series associated with the author
type: array