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
|
description: The `background-position` of the category background image, if one is set
|
||||||
isSection:
|
isSection:
|
||||||
type: number
|
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:
|
postQueue:
|
||||||
type: number
|
type: number
|
||||||
totalPostCount:
|
totalPostCount:
|
||||||
@@ -64,10 +70,4 @@ CategoryObject:
|
|||||||
description: The number of posts in the category
|
description: The number of posts in the category
|
||||||
totalTopicCount:
|
totalTopicCount:
|
||||||
type: number
|
type: number
|
||||||
description: The number of topics in the category
|
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
|
|
||||||
@@ -13,7 +13,7 @@ get:
|
|||||||
Subcategories are also returned, nested under a category's `children` property.
|
Subcategories are also returned, nested under a category's `children` property.
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: A list of category objectscurrently available to the accessing user
|
description: A list of category objects currently available to the accessing user
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ paths:
|
|||||||
$ref: 'write/users/uid/invites/groups.yaml'
|
$ref: 'write/users/uid/invites/groups.yaml'
|
||||||
/categories/:
|
/categories/:
|
||||||
$ref: 'write/categories.yaml'
|
$ref: 'write/categories.yaml'
|
||||||
|
/categories/{cid}:
|
||||||
|
$ref: 'write/categories/cid.yaml'
|
||||||
/groups/:
|
/groups/:
|
||||||
$ref: 'write/groups.yaml'
|
$ref: 'write/groups.yaml'
|
||||||
/groups/{slug}:
|
/groups/{slug}:
|
||||||
|
|||||||
@@ -54,4 +54,13 @@ post:
|
|||||||
status:
|
status:
|
||||||
$ref: ../components/schemas/Status.yaml#/Status
|
$ref: ../components/schemas/Status.yaml#/Status
|
||||||
response:
|
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:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
|
properties: {}
|
||||||
additionalProperties: {}
|
additionalProperties: {}
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
|
|||||||
Reference in New Issue
Block a user