mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add missing schema for category update and deletion
Deleted CategoryObj component, since CategoryObject is used more
This commit is contained in:
@@ -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'
|
||||
@@ -57,6 +57,12 @@ CategoryObject:
|
||||
description: The `background-position` of the category background image, if one is set
|
||||
isSection:
|
||||
type: number
|
||||
minTags:
|
||||
type: number
|
||||
description: Minimum tags per topic in this category
|
||||
maxTags:
|
||||
type: number
|
||||
description: Maximum tags per topic in this category
|
||||
postQueue:
|
||||
type: number
|
||||
totalPostCount:
|
||||
@@ -65,9 +71,3 @@ CategoryObject:
|
||||
totalTopicCount:
|
||||
type: number
|
||||
description: The number of topics in the category
|
||||
minTags:
|
||||
type: number
|
||||
description: Minimum tags per topic in this category
|
||||
maxTags:
|
||||
type: number
|
||||
description: Maximum tags per topic in this category
|
||||
@@ -70,6 +70,8 @@ paths:
|
||||
$ref: 'write/users/uid/invites/groups.yaml'
|
||||
/categories/:
|
||||
$ref: 'write/categories.yaml'
|
||||
/categories/{cid}:
|
||||
$ref: 'write/categories/cid.yaml'
|
||||
/groups/:
|
||||
$ref: 'write/groups.yaml'
|
||||
/groups/{slug}:
|
||||
|
||||
@@ -54,4 +54,13 @@ post:
|
||||
status:
|
||||
$ref: ../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
$ref: ../components/schemas/CategoryObj.yaml#/CategoryObj
|
||||
allOf:
|
||||
- $ref: ../components/schemas/CategoryObject.yaml#/CategoryObject
|
||||
- type: object
|
||||
properties:
|
||||
tagWhitelist:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
unread-class:
|
||||
type: string
|
||||
68
public/openapi/write/categories/cid.yaml
Normal file
68
public/openapi/write/categories/cid.yaml
Normal file
@@ -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: {}
|
||||
@@ -33,6 +33,7 @@ post:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties: {}
|
||||
additionalProperties: {}
|
||||
responses:
|
||||
'200':
|
||||
|
||||
Reference in New Issue
Block a user