feat: add missing schema for category update and deletion
Deleted CategoryObj component, since CategoryObject is used morev1.18.x
parent
7fc329de2f
commit
d6de925348
@ -1,72 +0,0 @@
|
|||||||
CategoryObj:
|
|
||||||
properties:
|
|
||||||
cid:
|
|
||||||
type: number
|
|
||||||
example: 1
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
example: My New Category
|
|
||||||
description:
|
|
||||||
type: string
|
|
||||||
example: Lorem ipsum, dolor sit amet
|
|
||||||
descriptionParsed:
|
|
||||||
type: string
|
|
||||||
example: Lorem ipsum, dolor sit amet
|
|
||||||
icon:
|
|
||||||
type: string
|
|
||||||
example: bullhorn
|
|
||||||
bgColor:
|
|
||||||
type: string
|
|
||||||
example: '#ffffff'
|
|
||||||
color:
|
|
||||||
type: string
|
|
||||||
example: '#000000'
|
|
||||||
slug:
|
|
||||||
type: string
|
|
||||||
example: 1/my-new-category
|
|
||||||
parentCid:
|
|
||||||
type: number
|
|
||||||
example: 0
|
|
||||||
topic_count:
|
|
||||||
type: number
|
|
||||||
example: 0
|
|
||||||
post_count:
|
|
||||||
type: number
|
|
||||||
example: 0
|
|
||||||
disabled:
|
|
||||||
type: number
|
|
||||||
example: 0
|
|
||||||
order:
|
|
||||||
type: number
|
|
||||||
example: 5
|
|
||||||
link:
|
|
||||||
type: number
|
|
||||||
example: 'https://example.org'
|
|
||||||
numRecentReplies:
|
|
||||||
type: number
|
|
||||||
example: 1
|
|
||||||
class:
|
|
||||||
type: string
|
|
||||||
example: col-md-3 col-xs-6
|
|
||||||
imageClass:
|
|
||||||
type: string
|
|
||||||
example: cover
|
|
||||||
isSection:
|
|
||||||
type: number
|
|
||||||
example: 0
|
|
||||||
totalPostCount:
|
|
||||||
type: number
|
|
||||||
example: 0
|
|
||||||
totalTopicCount:
|
|
||||||
type: number
|
|
||||||
example: 0
|
|
||||||
tagWhitelist:
|
|
||||||
type: array
|
|
||||||
example:
|
|
||||||
- some-tag
|
|
||||||
- another-tag
|
|
||||||
unread-class:
|
|
||||||
type: string
|
|
||||||
backgroundImage:
|
|
||||||
type: string
|
|
||||||
example: '/assets/images/covers/Circuit1.png'
|
|
@ -0,0 +1,68 @@
|
|||||||
|
put:
|
||||||
|
tags:
|
||||||
|
- topics
|
||||||
|
summary: update a category
|
||||||
|
description: This operation updates an existing category.
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cid
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
required: true
|
||||||
|
description: a valid category id
|
||||||
|
example: 1
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties: {}
|
||||||
|
additionalProperties: {}
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: category successfully updated
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
$ref: ../../components/schemas/Status.yaml#/Status
|
||||||
|
response:
|
||||||
|
allOf:
|
||||||
|
- $ref: ../../components/schemas/CategoryObject.yaml#/CategoryObject
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
tagWhitelist:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
unread-class:
|
||||||
|
type: string
|
||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- topics
|
||||||
|
summary: delete a category
|
||||||
|
description: This operation deletes and purges a category and all of its topics and posts (careful, there is no confirmation!)
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: cid
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
required: true
|
||||||
|
description: a valid category id
|
||||||
|
example: 1
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Category successfully deleted
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
$ref: ../../components/schemas/Status.yaml#/Status
|
||||||
|
response:
|
||||||
|
type: object
|
||||||
|
properties: {}
|
Loading…
Reference in New Issue